Tabnine Logo
ClassifiedTBox
Code IndexAdd Tabnine to your IDE (free)

How to use
ClassifiedTBox
in
it.unibz.inf.ontop.spec.ontology

Best Java code snippets using it.unibz.inf.ontop.spec.ontology.ClassifiedTBox (Showing top 20 results out of 315)

origin: ontop/ontop

private Assertion translate(OWLAxiom axiom) {
  try {
    if (axiom instanceof OWLClassAssertionAxiom)
      return owlapiTranslator.translate((OWLClassAssertionAxiom)axiom, tbox.classes());
    else if (axiom instanceof OWLObjectPropertyAssertionAxiom)
      return owlapiTranslator.translate((OWLObjectPropertyAssertionAxiom)axiom, tbox.objectProperties());
    else if (axiom instanceof OWLDataPropertyAssertionAxiom)
      return owlapiTranslator.translate((OWLDataPropertyAssertionAxiom)axiom, tbox.dataProperties());
  }
  catch (TranslationException | InconsistentOntologyException e) {
    return null;
  } 
  return null;
}
origin: ontop/ontop

/**
 * Assign indexes for the named DAG, use a depth first listener over the DAG 
 * @param reasoner used to know ancestors and descendants of the dag
 */

public SemanticIndexBuilder(ClassifiedTBox reasoner)  {
  classRanges = createSemanticIndex(reasoner.classesDAG());
  opRanges = createSemanticIndex(reasoner.objectPropertiesDAG());
  dpRanges = createSemanticIndex(reasoner.dataPropertiesDAG());
}
  
origin: ontop/ontop

private ImmutableMap<IRI, Datatype> getDescendentNodesPartialMap(ClassifiedTBox reasoner, DataRangeExpression node,
                                    Equivalences<DataRangeExpression> nodeSet) {
  if (node instanceof Datatype) {
    return reasoner.dataRangesDAG().getSub(nodeSet).stream()
        .map(Equivalences::getRepresentative)
        .filter(d -> d != node)
        .map(this::getPredicateIRI)
        .filter(Optional::isPresent)
        .collect(ImmutableCollectors.toMap(
            Optional::get,
            d -> (Datatype) node
        ));
  }
  return ImmutableMap.of();
}
origin: ontop/ontop

public Iterator<IRI> iEmptyRoles() {
  return new EmptyEntitiesIterator(onto.objectProperties().iterator(), onto.dataProperties().iterator(), conn);
}
origin: ontop/ontop

private void setIndex(String iri, int type, int idx) {
  if (type == CLASS_TYPE) {
    OClass c = reasonerDag.classes().get(iri);
    if (reasonerDag.classesDAG().getVertex(c) == null)
      throw new RuntimeException("UNKNOWN CLASS: " + iri);
    if (reasonerDag.objectProperties().contains(iri)) {
      ObjectPropertyExpression ope = reasonerDag.objectProperties().get(iri);
      if (cacheSI.getEntry(ope) != null)  {
        DataPropertyExpression dpe = reasonerDag.dataProperties().get(iri);
        if (reasonerDag.dataPropertiesDAG().getVertex(dpe) != null) {
          if (cacheSI.getEntry(dpe) != null)
            throw new RuntimeException("DUPLICATE PROPERTY: " + iri);
      DataPropertyExpression dpe = reasonerDag.dataProperties().get(iri);
      if (reasonerDag.dataPropertiesDAG().getVertex(dpe) != null) {
        if (cacheSI.getEntry(dpe) != null)
          throw new RuntimeException("DUPLICATE PROPERTY: " + iri);
origin: it.unibz.inf.ontop/ontop-mapping-core

private void checkObjectOrAnnotationProperty(String predicateIRI, PPMappingAssertionProvenance provenance,
                       Ontology ontology)
    throws MappingOntologyMismatchException {
  /*
   * Cannot be a data property (should be either an object or an annotation property)
   */
  if (ontology.tbox().dataProperties().contains(predicateIRI))
    throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
        DATA_PROPERTY_STR, OBJECT_PROPERTY_STR));
  /*
   * Cannot be a class
   */
  if (ontology.tbox().classes().contains(predicateIRI))
    throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
        CLASS_STR, OBJECT_PROPERTY_STR));
}
origin: it.unibz.inf.ontop/ontop-mapping-core

if (ontology.tbox().objectProperties().contains(predicateIRI))
  throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
      OBJECT_PROPERTY_STR, DATA_PROPERTY_STR));
if (ontology.tbox().classes().contains(predicateIRI))
  throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
      CLASS_STR, DATA_PROPERTY_STR));
origin: ontop/ontop

for (ClassExpression b : concepts) 
  if (b instanceof ObjectSomeValuesFrom)
    extension.addAll(reasoner.classesDAG().getSubRepresentatives(b));
concepts.addAll(extension);
    for (ClassExpression b : concepts) 
      if (b instanceof OClass) {
        Set<ClassExpression> bsubconcepts = reasoner.classesDAG().getSubRepresentatives(b);
        Iterator<ClassExpression> i = concepts.iterator();
        while (i.hasNext()) {
        ObjectSomeValuesFrom some = (ObjectSomeValuesFrom)b;
        ObjectPropertyExpression prop = some.getProperty();
        Set<ObjectPropertyExpression> bsubproperties = reasoner.objectPropertiesDAG().getSubRepresentatives(prop);
        Iterator<ClassExpression> i = concepts.iterator();
        while (i.hasNext()) {
origin: ontop/ontop

public Intersection<ClassExpression> getSubConcepts(Collection<Function> atoms) {
  Intersection<ClassExpression> subc = new Intersection<>(reasoner.classesDAG());
  for (Function a : atoms) {
    Optional<IRI> optionalClassIRI = extractClassIRI(a);
    if (!optionalClassIRI.isPresent()) {
      subc.setToBottom();   // binary predicates R(x,x) cannot be matched to the anonymous part
      break;
    }
    IRI classIRI = optionalClassIRI.get();
     if (reasoner.classes().contains(classIRI))
       subc.intersectWith(reasoner.classes().get(classIRI));
     else
       subc.setToBottom();
     if (subc.isBottom())
       break;
  }
  return subc;
}

origin: ontop/ontop

Intersection<ObjectPropertyExpression> properties = propertiesCache.get(idx);            
if (properties == null) {
  properties = new Intersection<>(reasoner.objectPropertiesDAG());
  for (Function a : edge.getBAtoms()) {
    if (a.isOperation()) {
      Optional<IRI> optionalPropertyIRIString = extractPropertyIRI(a);
      if (optionalPropertyIRIString
          .filter(i -> reasoner.objectProperties().contains(i))
          .isPresent()) {
        ObjectPropertyExpression prop = reasoner.objectProperties().get(optionalPropertyIRIString.get());
        if (!root.equals(a.getTerm(0)))
            prop = prop.getInverse();
origin: ontop/ontop

public Set<ClassExpression> getSubConcepts() {
  if (subconcepts == null) {
    subconcepts = new HashSet<>();
    for (ClassExpression con : concepts)
      subconcepts.addAll(reasoner.classesDAG().getSubRepresentatives(con));
  }
  return subconcepts;
}

origin: ontop/ontop

public Intersection<ObjectPropertyExpression> getTopProperty() {
  return new Intersection<>(reasoner.objectPropertiesDAG());
}

origin: ontop/ontop

public Iterator<IRI> iEmptyConcepts() {
  return new EmptyEntitiesIterator(onto.classes().iterator(), conn);
}
origin: ontop/ontop

DataPropertyExpression dpe = reasonerDag.dataPropertiesDAG().getCanonicalForm(dpe0);
int idx = cacheSI.getEntry(dpe).getIndex();
origin: ontop/ontop

if (classIRI.isPresent() && reasoner.classes().contains(classIRI.get())) {
  OClass c = reasoner.classes().get(classIRI.get());
  OClass equivalent = (OClass)reasoner.classesDAG().getCanonicalForm(c);
  if (equivalent != null && !equivalent.equals(c)) {
    return atomFactory.getMutableTripleBodyAtom(bodyAtom.getTerm(0), equivalent.getIRI());
else if (propertyIRI.isPresent() && reasoner.objectProperties().contains(propertyIRI.get())) {
  ObjectPropertyExpression ope = reasoner.objectProperties().get(propertyIRI.get());
  ObjectPropertyExpression equivalent = reasoner.objectPropertiesDAG().getCanonicalForm(ope);
  if (equivalent != null && !equivalent.equals(ope)) {
    if (!equivalent.isInverse())
else if (propertyIRI.isPresent()  && reasoner.dataProperties().contains(propertyIRI.get())) {
  DataPropertyExpression dpe = reasoner.dataProperties().get(propertyIRI.get());
  DataPropertyExpression equivalent = reasoner.dataPropertiesDAG().getCanonicalForm(dpe);
  if (equivalent != null && !equivalent.equals(dpe)) {
    return atomFactory.getMutableTripleBodyAtom(bodyAtom.getTerm(0), equivalent.getIRI(), bodyAtom.getTerm(2));
origin: it.unibz.inf.ontop/ontop-mapping-core

private void checkClass(String predicateIRI, PPMappingAssertionProvenance provenance,
            Ontology ontology) throws MappingOntologyMismatchException {
  /*
   * Cannot be an object property
   */
  if (ontology.tbox().objectProperties().contains(predicateIRI))
    throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
        OBJECT_PROPERTY_STR, CLASS_STR));
  /*
   * Cannot be a data property
   */
  else if (ontology.tbox().dataProperties().contains(predicateIRI))
    throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
        DATA_PROPERTY_STR, CLASS_STR));
  /*
   * Cannot be an annotation property
   */
  if (ontology.annotationProperties().contains(predicateIRI))
    throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
        ANNOTATION_PROPERTY_STR, DATA_PROPERTY_STR));
}
origin: ontop/ontop

private void checkObjectOrAnnotationProperty(IRI predicateIRI, PPMappingAssertionProvenance provenance,
                       Ontology ontology)
    throws MappingOntologyMismatchException {
  /*
   * Cannot be a data property (should be either an object or an annotation property)
   */
  if (ontology.tbox().dataProperties().contains(predicateIRI))
    throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
        DATA_PROPERTY_STR, OBJECT_PROPERTY_STR));
  /*
   * Cannot be a class
   */
  if (ontology.tbox().classes().contains(predicateIRI))
    throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
        CLASS_STR, OBJECT_PROPERTY_STR));
}
origin: ontop/ontop

if (ontology.tbox().objectProperties().contains(predicateIRI))
  throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
      OBJECT_PROPERTY_STR, DATA_PROPERTY_STR));
if (ontology.tbox().classes().contains(predicateIRI))
  throw new MappingOntologyMismatchException(generatePropertyOrClassConflictMessage(predicateIRI, provenance,
      CLASS_STR, DATA_PROPERTY_STR));
origin: ontop/ontop

public Intersection<ClassExpression> getTopClass() {
  return new Intersection<>(reasoner.classesDAG());
}
origin: ontop/ontop

  throw new RuntimeException("INVERSE PROPERTIES ARE NOT SUPPORTED IN ABOX:" + ax);
ObjectPropertyExpression ope = reasonerDag.objectPropertiesDAG().getCanonicalForm(ope0);
it.unibz.inf.ontop.spec.ontologyClassifiedTBox

Javadoc

This is the interface for the class ClassifiedTBox where we are able to retrieve all the connection built in our DAG

Most used methods

  • classes
    classes
  • classesDAG
  • dataProperties
    data properties
  • dataPropertiesDAG
  • objectProperties
    object properties
  • objectPropertiesDAG
  • dataRangesDAG
    datatypes and data property ranges
  • disjointClasses
  • disjointDataProperties
  • disjointObjectProperties
  • functionalDataProperties
  • functionalObjectProperties
  • functionalDataProperties,
  • functionalObjectProperties

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now