protected boolean isDataPropertyLax(IRI node) { return consumer.isDataProperty(node); }
protected boolean isDataPropertyLax(IRI node) { return consumer.isDataProperty(node); }
@Override public boolean canHandle(IRI subject, IRI predicate, IRI object) { inferTypes(subject, object); return super.canHandle(subject, predicate, object) && ((getConsumer().isObjectProperty(subject) && getConsumer().isObjectProperty(object)) || (getConsumer().isDataProperty(subject) && getConsumer().isDataProperty(object))); }
@Override public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException { Set<OWLAnnotation> pendingAnnotations = getPendingAnnotations(); if (getConsumer().isObjectProperty(subject) && getConsumer().isObjectProperty(object)) { Set<OWLObjectPropertyExpression> props = new HashSet<OWLObjectPropertyExpression>(); props.add(translateObjectProperty(subject)); props.add(translateObjectProperty(object)); addAxiom(getDataFactory().getOWLEquivalentObjectPropertiesAxiom(props, pendingAnnotations)); consumeTriple(subject, predicate, object); } if (getConsumer().isDataProperty(subject) && getConsumer().isDataProperty(object)) { Set<OWLDataPropertyExpression> props = new HashSet<OWLDataPropertyExpression>(); props.add(translateDataProperty(subject)); props.add(translateDataProperty(object)); addAxiom(getDataFactory().getOWLEquivalentDataPropertiesAxiom(props, pendingAnnotations)); consumeTriple(subject, predicate, object); } // TODO: LOG ERROR }
@Override public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException { if(getConsumer().isDataProperty(subject) && getConsumer().isDataProperty(object)) { addAxiom(getDataFactory().getOWLDisjointDataPropertiesAxiom(CollectionFactory.createSet(translateDataProperty(subject), translateDataProperty(object)), getPendingAnnotations())); consumeTriple(subject, predicate, object); } if(getConsumer().isObjectProperty(subject) && getConsumer().isObjectProperty(object)) { addAxiom(getDataFactory().getOWLDisjointObjectPropertiesAxiom(CollectionFactory.createSet(translateObjectProperty(subject), translateObjectProperty(object)), getPendingAnnotations())); consumeTriple(subject, predicate, object); } }
@Override public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException { if (getConsumer().isObjectProperty(subject)) { addAxiom(getDataFactory().getOWLFunctionalObjectPropertyAxiom(translateObjectProperty(subject), getPendingAnnotations())); consumeTriple(subject, predicate, object); } if (getConsumer().isDataProperty(subject)) { addAxiom(getDataFactory().getOWLFunctionalDataPropertyAxiom(translateDataProperty(subject), getPendingAnnotations())); consumeTriple(subject, predicate, object); } } }
@Override public boolean canHandleStreaming(IRI subject, IRI predicate, IRI object) { if(getConsumer().isObjectProperty(object)) { getConsumer().addObjectProperty(subject, false); } else if(getConsumer().isDataProperty(object)) { getConsumer().addDataProperty(object, false); } else if(getConsumer().isAnnotationProperty(object)) { getConsumer().addAnnotationProperty(subject, false); } else if(getConsumer().isObjectProperty(subject)) { getConsumer().addObjectProperty(object, false); } else if(getConsumer().isDataProperty(subject)) { getConsumer().addDataProperty(object, false); } else if(getConsumer().isAnnotationProperty(subject)) { getConsumer().addAnnotationProperty(object, false); } return false; }
@Override @SuppressWarnings("deprecation") public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException { // First check for object property chain if (!isStrict() && getConsumer().hasPredicate(subject, OWLRDFVocabulary.OWL_PROPERTY_CHAIN.getIRI())) { // Property chain IRI chainList = getConsumer().getResourceObject(subject, OWLRDFVocabulary.OWL_PROPERTY_CHAIN.getIRI(), true); List<OWLObjectPropertyExpression> properties = getConsumer().translateToObjectPropertyList(chainList); addAxiom(getDataFactory().getOWLSubPropertyChainOfAxiom(properties, translateObjectProperty(object), getPendingAnnotations())); consumeTriple(subject, predicate, object); } else if (!isStrict() && getConsumer().hasPredicate(subject, OWLRDFVocabulary.RDF_FIRST.getIRI())) { // Legacy object property chain representation List<OWLObjectPropertyExpression> properties = getConsumer().translateToObjectPropertyList(subject); addAxiom(getDataFactory().getOWLSubPropertyChainOfAxiom(properties, translateObjectProperty(object), getPendingAnnotations())); consumeTriple(subject, predicate, object); } else if (getConsumer().isObjectProperty(subject) && getConsumer().isObjectProperty(object)) { translateSubObjectProperty(subject, predicate, object); } else if (getConsumer().isDataProperty(subject) && getConsumer().isDataProperty(object)) { translateSubDataProperty(subject, predicate, object); } else if(!isStrict()) { OWLAnnotationProperty subAnnoProp = getDataFactory().getOWLAnnotationProperty(subject); OWLAnnotationProperty superAnnoProp = getDataFactory().getOWLAnnotationProperty(object); addAxiom(getDataFactory().getOWLSubAnnotationPropertyOfAxiom(subAnnoProp, superAnnoProp, getPendingAnnotations())); consumeTriple(subject, predicate, object); } }
@Override @SuppressWarnings("deprecation") public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException { IRI source = getConsumer().getResourceObject(subject, OWLRDFVocabulary.OWL_SOURCE_INDIVIDUAL.getIRI(), true); if (source == null) { source = getConsumer().getResourceObject(subject, OWLRDFVocabulary.RDF_SUBJECT.getIRI(), true); } IRI property = getConsumer().getResourceObject(subject, OWLRDFVocabulary.OWL_ASSERTION_PROPERTY.getIRI(), true); if (property == null) { property = getConsumer().getResourceObject(subject, OWLRDFVocabulary.RDF_PREDICATE.getIRI(), true); } Object target = getConsumer().getResourceObject(subject, OWLRDFVocabulary.OWL_TARGET_INDIVIDUAL.getIRI(), true); if (target == null) { target = getConsumer().getLiteralObject(subject, OWLRDFVocabulary.OWL_TARGET_VALUE.getIRI(), true); } if (target == null) { target = getConsumer().getResourceObject(subject, OWLRDFVocabulary.RDF_OBJECT.getIRI(), true); } if (target == null) { target = getConsumer().getLiteralObject(subject, OWLRDFVocabulary.RDF_OBJECT.getIRI(), true); } Set<OWLAnnotation> annos = getConsumer().translateAnnotations(subject); if (target instanceof OWLLiteral && (!isStrict() || getConsumer().isDataProperty(property))) { translateNegativeDataPropertyAssertion(subject, predicate, object, source, property, (OWLLiteral) target, annos); } else if(target instanceof IRI && (!isStrict() || getConsumer().isObjectProperty(property))) { translateNegativeObjectPropertyAssertion(subject, predicate, object, source, property, (IRI) target, annos); } // TODO LOG ERROR }