protected OWLClassExpression translateClassExpression(IRI IRI) { return consumer.translateClassExpression(IRI); }
protected OWLClassExpression translateToClassExpression(IRI mainNode) { return consumer.translateClassExpression(mainNode); }
protected OWLClassExpression translateClassExpression(IRI IRI) { return consumer.translateClassExpression(IRI); }
public OWLClassExpression translate(IRI IRI) { return consumer.translateClassExpression(IRI); }
@Override public OWLClassExpression translate(IRI iri) { consumer.addClassExpression(iri, false); return consumer.translateClassExpression(iri); }
@Override protected OWLClassExpression translateEquivalentClass(IRI mainNode) { return getDataFactory().getOWLObjectComplementOf(getConsumer().translateClassExpression(mainNode)); } }
protected OWLClassExpression translateEquivalentClass(IRI mainNode) { return getDataFactory().getOWLObjectComplementOf(getConsumer().translateClassExpression(mainNode)); } }
@Override public OWLObjectComplementOf translate(IRI mainNode) { IRI complementOfObject = getConsumer().getResourceObject(mainNode, OWL_COMPLEMENT_OF, true); OWLClassExpression operand = getConsumer().translateClassExpression(complementOfObject); return getDataFactory().getOWLObjectComplementOf(operand); } }
protected OWLClassExpression translateRestriction(IRI mainNode) { IRI propertyIRI = getResourceObject(mainNode, OWLRDFVocabulary.OWL_ON_PROPERTY.getIRI(), true); IRI fillerIRI = getResourceObject(mainNode, OWLRDFVocabulary.OWL_HAS_VALUE.getIRI(), true); OWLClassExpression ce = null; if(fillerIRI != null) { OWLClassExpression filler = getConsumer().translateClassExpression(fillerIRI); // ce = getDataFactory().getOWLObjectHasValue(prop, filler); } else { OWLLiteral lit = getLiteralObject(mainNode, OWLRDFVocabulary.OWL_HAS_VALUE.getIRI(), true); } return null; } }
@Override public OWLObjectExactCardinality translate(IRI mainNode) { int cardi = translateInteger(mainNode, OWL_QUALIFIED_CARDINALITY); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerIRI = getConsumer().getResourceObject(mainNode, OWL_ON_CLASS, true); OWLClassExpression filler = getConsumer().translateClassExpression(fillerIRI); return getDataFactory().getOWLObjectExactCardinality(cardi, property, filler); } }
@Override public OWLObjectMinCardinality translate(IRI mainNode) { int cardi = translateInteger(mainNode, OWL_MIN_QUALIFIED_CARDINALITY); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerIRI = getConsumer().getResourceObject(mainNode, OWL_ON_CLASS, true); OWLClassExpression filler = getConsumer().translateClassExpression(fillerIRI); return getDataFactory().getOWLObjectMinCardinality(cardi, property, filler); } }
@Override public OWLObjectMaxCardinality translate(IRI mainNode) { int cardi = translateInteger(mainNode, OWL_MAX_QUALIFIED_CARDINALITY); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerIRI = getConsumer().getResourceObject(mainNode, OWL_ON_CLASS, true); OWLClassExpression filler = getConsumer().translateClassExpression(fillerIRI); return getDataFactory().getOWLObjectMaxCardinality(cardi, property, filler); } }
public boolean canHandleStreaming(IRI subject, IRI predicate, IRI object) { OWLRDFConsumer consumer = getConsumer(); IRI propIRI = consumer.getResourceObject(subject, OWLRDFVocabulary.OWL_ON_PROPERTY.getIRI(), false); if(propIRI != null && (!consumer.isAnonymousNode(object) || consumer.getClassExpressionIfTranslated(object) != null)) { // The filler is either a datatype or named class if(consumer.isObjectPropertyOnly(propIRI)) { consumer.addOWLClass(object); consumer.addTriple(subject, predicate, object); consumer.translateClassExpression(subject); return true; } else if(consumer.isDataPropertyOnly(propIRI)) { } } return false; }
@Override public boolean canHandleStreaming(IRI subject, IRI predicate, IRI object) { OWLRDFConsumer consumer = getConsumer(); consumer.addOWLRestriction(subject, false); IRI propIRI = consumer.getResourceObject(subject, OWLRDFVocabulary.OWL_ON_PROPERTY.getIRI(), false); if (propIRI != null && (!consumer.isAnonymousNode(object) || consumer.getClassExpressionIfTranslated(object) != null)) { // The filler is either a datatype or named class if (consumer.isObjectPropertyOnly(propIRI)) { consumer.addClassExpression(object, false); consumer.addTriple(subject, predicate, object); consumer.translateClassExpression(subject); return true; } else if (consumer.isDataPropertyOnly(propIRI)) { } } return false; }
@Override public OWLObjectSomeValuesFrom translate(IRI mainNode) { getConsumer().consumeTriple(mainNode, RDF_TYPE.getIRI(), OWL_RESTRICTION.getIRI()); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerMainNode = getConsumer().getResourceObject(mainNode, OWL_SOME_VALUES_FROM, true); OWLClassExpression filler = getConsumer().translateClassExpression(fillerMainNode); return getDataFactory().getOWLObjectSomeValuesFrom(property, filler); } }
@Override public OWLObjectAllValuesFrom translate(IRI mainNode) { getConsumer().consumeTriple(mainNode, RDF_TYPE.getIRI(), OWL_RESTRICTION.getIRI()); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerMainNode = getConsumer().getResourceObject(mainNode, OWL_ALL_VALUES_FROM, true); OWLClassExpression filler = getConsumer().translateClassExpression(fillerMainNode); return getDataFactory().getOWLObjectAllValuesFrom(property, filler); } }
public OWLClassExpression parseClassExpression(BNode classExpressionNode) throws RepositoryException { RepositoryConnection connection = repository.getConnection(); try { RepositoryResult<Statement> triples = connection.getStatements(classExpressionNode, null, null, false); Statement stmt = triples.next(); org.openrdf.model.URI axiomId = (org.openrdf.model.URI) stmt.getContext(); OWLRDFConsumer consumer = consumeTriples(connection, axiomId); String nodeName = generateName(classExpressionNode); OWLClassExpression ce = consumer.translateClassExpression(IRI.create(nodeName)); consumer.endModel(); if (!((TrackingOntologyFormat) consumer.getOntologyFormat()).getFailed()) { return ce; } else { return null; } } catch (Exception e) { if (e instanceof RepositoryException) { throw (RepositoryException) e; } else { throw new RepositoryException(e); } } finally { connection.close(); } }
@Override public OWLObjectMinCardinality translate(IRI mainNode) { getConsumer().consumeTriple(mainNode, RDF_TYPE.getIRI(), OWL_RESTRICTION.getIRI()); int cardi = translateInteger(mainNode, OWL_MIN_CARDINALITY); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerIRI = getConsumer().getResourceObject(mainNode, OWL_ON_CLASS, true); if (fillerIRI != null && !getConsumer().getConfiguration().isStrict()) { // Be tolerant OWLClassExpression filler = getConsumer().translateClassExpression(fillerIRI); return getDataFactory().getOWLObjectMinCardinality(cardi, property, filler); } else { return getDataFactory().getOWLObjectMinCardinality(cardi, property); } } }
@Override public OWLObjectMaxCardinality translate(IRI mainNode) { getConsumer().consumeTriple(mainNode, RDF_TYPE.getIRI(), OWL_RESTRICTION.getIRI()); int cardi = translateInteger(mainNode, OWL_MAX_CARDINALITY); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerIRI = getConsumer().getResourceObject(mainNode, OWL_ON_CLASS, true); if (fillerIRI != null && !getConsumer().getConfiguration().isStrict()) { // Be tolerant OWLClassExpression filler = getConsumer().translateClassExpression(fillerIRI); return getDataFactory().getOWLObjectMaxCardinality(cardi, property, filler); } else { return getDataFactory().getOWLObjectMaxCardinality(cardi, property); } } }
@Override public OWLObjectExactCardinality translate(IRI mainNode) { getConsumer().consumeTriple(mainNode, RDF_TYPE.getIRI(), OWL_RESTRICTION.getIRI()); int cardi = translateInteger(mainNode, OWL_CARDINALITY); IRI propertyIRI = getConsumer().getResourceObject(mainNode, OWL_ON_PROPERTY, true); OWLObjectPropertyExpression property = getConsumer().translateObjectPropertyExpression(propertyIRI); IRI fillerIRI = getConsumer().getResourceObject(mainNode, OWL_ON_CLASS, true); if (fillerIRI != null && !getConsumer().getConfiguration().isStrict()) { // Be tolerant OWLClassExpression filler = getConsumer().translateClassExpression(fillerIRI); return getDataFactory().getOWLObjectExactCardinality(cardi, property, filler); } else { return getDataFactory().getOWLObjectExactCardinality(cardi, property); } } }