openllet.owlapi.OWL.Ontology()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中openllet.owlapi.OWL.Ontology()方法的一些代码示例,展示了OWL.Ontology()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OWL.Ontology()方法的具体详情如下:
包路径:openllet.owlapi.OWL
类名称:OWL
方法名:Ontology

OWL.Ontology介绍

暂无

代码示例

代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi

public static OWLOntology Ontology(final Stream<? extends OWLAxiom> axioms, final IRI iri)
{
  return Ontology(_manager, axioms, iri);
}

代码示例来源:origin: Galigator/openllet

public static OWLOntology Ontology(final Stream<? extends OWLAxiom> axioms, final IRI iri)
{
  return Ontology(_manager, axioms, iri);
}

代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi

public static OWLOntology Ontology(final OWLOntologyManager manager, final Collection<? extends OWLAxiom> axioms)
{
  return Ontology(manager, axioms.stream());
}

代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi

public static OWLOntology Ontology(final OWLOntologyManager manager, final Collection<? extends OWLAxiom> axioms, final IRI iri)
{
  return Ontology(manager, axioms.stream(), iri);
}

代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi

public static OWLOntology Ontology(final Collection<? extends OWLAxiom> axioms)
{
  return Ontology(_manager, axioms.stream());
}

代码示例来源:origin: Galigator/openllet

public static OWLOntology Ontology(final OWLOntologyManager manager, final OWLAxiom... axioms)
{
  return Ontology(manager, Arrays.asList(axioms));
}

代码示例来源:origin: Galigator/openllet

public static OWLOntology Ontology(final Collection<? extends OWLAxiom> axioms, final IRI iri)
{
  return Ontology(_manager, axioms.stream(), iri);
}

代码示例来源:origin: Galigator/openllet

public static OWLOntology Ontology(final OWLOntologyManager manager, final Stream<? extends OWLAxiom> axioms)
{
  return Ontology(manager, axioms, IRI.create("http://www.example.org/ontology" + UUID.randomUUID()));
}

代码示例来源:origin: com.github.galigator.openllet/openllet-explanation

@Override
  public void endRendering() throws IOException
  {
    final OWLOntology ontology = OWL.Ontology(_axioms);
    final RDFXMLRenderer renderer = new RDFXMLRenderer(ontology, new PrintWriter(_writer));
    renderer.render();
  }
}

代码示例来源:origin: Galigator/openllet

@Override
  public void endRendering() throws IOException
  {
    final OWLOntology ontology = OWL.Ontology(_axioms);
    final RDFXMLRenderer renderer = new RDFXMLRenderer(ontology, new PrintWriter(_writer));
    renderer.render();
  }
}

代码示例来源:origin: Galigator/openllet

@Override
  public void endRendering() throws IOException
  {
    final OWLOntology ontology = OWL.Ontology(_axioms);
    final RDFXMLRenderer renderer = new RDFXMLRenderer(ontology, new PrintWriter(_writer));
    renderer.render();
  }
}

代码示例来源:origin: Galigator/openllet

public void createReasoner(final OWLAxiom... axioms)
{
  _manager.clearOntologies();
  _ontology = OWL.Ontology(_manager, axioms);
  _reasoner = OpenlletReasonerFactory.getInstance().createReasoner(_ontology);
}

代码示例来源:origin: Galigator/openllet

public IncrementalClassifier(final PersistedState persistedState)
{
  _extractor = persistedState.getModuleExtractor();
  _taxonomyImpl = persistedState.getTaxonomy();
  _realized = persistedState.isRealized();
  _modules = _extractor.getModules();
  final OWLOntology ontology = OWL.Ontology(_extractor.axioms());
  _reasoner = OpenlletReasonerFactory.getInstance().createReasoner(ontology);
  _reasoner.getManager().addOntologyChangeListener(this);
}

代码示例来源:origin: Galigator/openllet

public IncrementalClassifier(final PersistedState persistedState)
{
  _extractor = persistedState.getModuleExtractor();
  _taxonomyImpl = persistedState.getTaxonomy();
  _realized = persistedState.isRealized();
  _modules = _extractor.getModules();
  final OWLOntology ontology = OWL.Ontology(_extractor.axioms());
  _reasoner = OpenlletReasonerFactory.getInstance().createReasoner(ontology);
  _reasoner.getManager().addOntologyChangeListener(this);
}

代码示例来源:origin: Galigator/openllet

@Test
public void typeInheritanceWithAnonIndividual()
{
  final OWLAxiom[] axioms = { OWL.subClassOf(_C, _D), OWL.classAssertion(_anon, _C) };
  final OWLOntology ont = OWL.Ontology(axioms);
  final OpenlletReasoner pellet = OpenlletReasonerFactory.getInstance().createReasoner(ont);
  assertTrue(pellet.getInstances(_D, true).nodes().count() == 0);
  assertTrue(pellet.getInstances(_D, false).nodes().count() == 1);
}

代码示例来源:origin: Galigator/openllet

@Test
public void testSubClassDirectParameter()
{
  final OWLAxiom[] axioms = { OWL.subClassOf(_E, _D), OWL.subClassOf(_D, _C) };
  final OWLOntology ont = OWL.Ontology(axioms);
  final OpenlletReasoner pellet = OpenlletReasonerFactory.getInstance().createReasoner(ont);
  assertTrue(pellet.getSubClasses(_C, true).nodes().count() == 1);
  assertTrue(pellet.getSubClasses(_C, false).nodes().count() == 3); // includes owl:Nothing
}

代码示例来源:origin: Galigator/openllet

@Test
public void testPunningSingletonOneOf()
{
  final OWLClass A = OWL.Class("A");
  final OWLIndividual a = OWL.Individual("A");
  final Set<OWLAxiom> axioms = new HashSet<>();
  axioms.add(OWL.equivalentClasses(A, OWL.oneOf(a)));
  final OWLOntology ontology = OWL.Ontology(axioms);
  final OpenlletReasoner reasoner = OpenlletReasonerFactory.getInstance().createReasoner(ontology);
  final PelletExplanation explain = new PelletExplanation(reasoner);
  assertEquals(axioms, explain.getEntailmentExplanation(OWL.classAssertion(a, A)));
}

代码示例来源:origin: Galigator/openllet

@Test
public void testTopBottomPropertyAssertion()
{
  final OWLAxiom[] axioms = { OWL.propertyAssertion(_a, OWL.topObjectProperty, _b), OWL.propertyAssertion(_a, OWL.topDataProperty, _lit), OWL.propertyAssertion(_a, OWL.bottomObjectProperty, _b), OWL.propertyAssertion(_a, OWL.bottomDataProperty, _lit) };
  for (int i = 0; i < axioms.length; i++)
  {
    final OWLOntology ont = OWL.Ontology(axioms[i]);
    final OpenlletReasoner pellet = OpenlletReasonerFactory.getInstance().createReasoner(ont);
    assertEquals(i < 2, pellet.isConsistent());
  }
}

代码示例来源:origin: Galigator/openllet

private static OpenlletReasoner setupReasonerIndividualNodeSetPolicy(final IndividualNodeSetPolicy p)
{
  final OWLAxiom[] axioms = { OWL.classAssertion(_a, _C), OWL.classAssertion(_b, _C), OWL.classAssertion(_c, _C), OWL.sameAs(_a, _b), OWL.differentFrom(_b, _c), OWL.differentFrom(_a, _c) };
  final OWLOntology ont = OWL.Ontology(axioms);
  final OWLReasonerConfiguration config = new SimpleConfiguration(new NullReasonerProgressMonitor(), FreshEntityPolicy.ALLOW, Long.MAX_VALUE, p);
  final OpenlletReasoner pellet = OpenlletReasonerFactory.getInstance().createReasoner(ont, config);
  return pellet;
}

代码示例来源:origin: Galigator/openllet

public void testLuigiFamilyOWLApi() throws Exception
{
  final OWLOntologyManager manager = OWL._manager;
  final OWLOntology familyRef = manager.loadOntology(IRI.create(_base + "basicFamilyReference.owl"));
  final OWLOntology familyRules = manager.loadOntology(IRI.create(_base + "basicFamilyRules.owl"));
  final OWLOntology mergedOntology = OWL.Ontology(Stream.concat(familyRef.axioms(), familyRules.axioms()));
  final OpenlletReasoner reasoner = openllet.owlapi.OpenlletReasonerFactory.getInstance().createReasoner(mergedOntology);
  final OWLIndividual nella = OWL.Individual(_luigiFamily.resolve("#Nella"));
  final OWLObjectProperty hasUncle = OWL.ObjectProperty(_luigiFamily.resolve("#hasUncle"));
  final OWLIndividual dino = OWL.Individual(_luigiFamily.resolve("#Dino"));
  assertFalse(reasoner.isEntailed(OWL.propertyAssertion(nella, hasUncle, dino)));
}

相关文章