protected boolean isNonNegativeIntegerLax(IRI mainNode, OWLRDFVocabulary predicate) { OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate, false); if (literal == null) { return false; } return OWL2Datatype.XSD_INTEGER.isInLexicalSpace(literal.getLiteral().trim()); }
protected boolean isNonNegativeIntegerStrict(IRI mainNode, OWLRDFVocabulary predicate) { OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate, false); if (literal == null) { return false; } OWLDatatype datatype = literal.getDatatype(); OWL2Datatype nni = OWL2Datatype.XSD_NON_NEGATIVE_INTEGER; return datatype.getIRI().equals(nni.getIRI()) && nni.isInLexicalSpace(literal.getLiteral()); }
protected int translateInteger(IRI mainNode, OWLRDFVocabulary predicate) { OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate, true); if (literal == null) { return 0; } try { return Integer.parseInt(literal.getLiteral().trim()); } catch (NumberFormatException e) { return 0; } }
protected boolean isResourceListStrict(IRI mainNode, TypeMatcher typeMatcher, int minSize) { if (mainNode == null) { return false; } IRI currentListNode = mainNode; Set<IRI> visitedListNodes = new HashSet<IRI>(); int size = 0; while (true) { IRI firstObject = consumer.getResourceObject(currentListNode, RDF_FIRST, false); if (firstObject == null) { return false; } if (!typeMatcher.isTypeStrict(firstObject)) { // Something in the list that is not of the required type return false; } else { size++; } IRI restObject = consumer.getResourceObject(currentListNode, RDF_REST, false); if (visitedListNodes.contains(restObject)) { // Cycle - Non-terminating return false; } if (restObject == null) { // Not terminated properly return false; } if (restObject.equals(RDF_NIL.getIRI())) { // Terminated properly return size >= minSize; } // Carry on visitedListNodes.add(restObject); currentListNode = restObject; } }
protected boolean isClassExpressionLax(IRI mainNode) { return consumer.isClassExpression(mainNode) || consumer.isParsedAllTriples() && !consumer.isDataRange(mainNode); }
protected void addAxiom(OWLAxiom axiom) { consumer.addAxiom(axiom); }
protected boolean isDataRangeLax(IRI node) { return consumer.isDataRange(node); }
protected boolean isDataPropertyStrict(IRI mainNode, OWLRDFVocabulary predicate) { IRI object = consumer.getResourceObject(mainNode, predicate, false); return object != null && isDataPropertyStrict(object); }
protected boolean isDataRangeStrict(IRI node) { return consumer.isDataRange(node) && !consumer.isClassExpression(node); }
protected OWLIndividual translateIndividual(IRI IRI) { return consumer.translateIndividual(IRI); }
protected boolean isAnonymous(IRI node) { return consumer.isAnonymousNode(node); }
protected OWLDataPropertyExpression translateDataProperty(IRI IRI) { return consumer.translateDataPropertyExpression(IRI); }
protected OWLDataRange translateDataRange(IRI IRI) { return consumer.translateDataRange(IRI); }
protected OWLObjectPropertyExpression translateObjectProperty(IRI IRI) { return consumer.translateObjectPropertyExpression(IRI); }
protected OWLClassExpression translateClassExpression(IRI IRI) { return consumer.translateClassExpression(IRI); }
protected OWLDataFactory getDataFactory() { return consumer.getDataFactory(); }
protected boolean isClassExpressionLax(IRI mainNode, OWLRDFVocabulary predicate) { IRI object = consumer.getResourceObject(mainNode, predicate, false); return object != null && isClassExpressionLax(object); }
protected boolean isResourcePresent(IRI mainNode, OWLRDFVocabulary predicate) { return consumer.getResourceObject(mainNode, predicate, false) != null; }
protected boolean isDataPropertyStrict(IRI node) { return consumer.isDataPropertyOnly(node); }
protected boolean isLiteralPresent(IRI mainNode, OWLRDFVocabulary predicate) { return consumer.getLiteralObject(mainNode, predicate, false) != null; }
protected boolean isDataPropertyLax(IRI node) { return consumer.isDataProperty(node); }
protected boolean isRestrictionLax(IRI node) { return consumer.isRestriction(node); }
protected boolean isDataRangeStrict(IRI mainNode, OWLRDFVocabulary predicate) { IRI object = consumer.getResourceObject(mainNode, predicate, false); return isDataRangeStrict(object); }
protected void consumeTriple(IRI subject, IRI predicate, OWLLiteral object) { consumer.consumeTriple(subject, predicate, object); }
protected boolean isDataRangeLax(IRI mainNode, OWLRDFVocabulary predicate) { IRI object = consumer.getResourceObject(mainNode, predicate, false); return object != null && isDataRangeLax(mainNode); }
protected boolean isAnnotationPropertyStrict(IRI iri) { return consumer.isAnnotationPropertyOnly(iri); }
protected Set<OWLAnnotation> getPendingAnnotations() { return consumer.getPendingAnnotations(); }
protected boolean isAnnotationPropertyLax(IRI iri) { return consumer.isAnnotationProperty(iri); }
protected boolean isStrict() { return consumer.getConfiguration().isStrict(); }
protected boolean isDataPropertyOnly(IRI iri) { return consumer.isDataPropertyOnly(iri); }