/** * Determines if this is a valid OWL 2 DL ontology ID. To be a valid OWL 2 * DL ID, the ontology IRI and version IRI must not be reserved vocabulary. * * @return {@code true} if this is a valid OWL 2 DL ontology ID, otherwise {@code false} * @see org.semanticweb.owlapi.model.IRI#isReservedVocabulary() */ public boolean isOWL2DLOntologyID() { return !ontologyIRI.isPresent() || !ontologyIRI.get().isReservedVocabulary() && ( !versionIRI.isPresent() || !versionIRI.get().isReservedVocabulary()); }
/** * Checks if is general predicate. * * @param predicate the predicate * @return true, if is general predicate */ protected static boolean isGeneralPredicate(IRI predicate) { return !predicate.isReservedVocabulary() || BUILT_IN_AP_IRIS.contains(predicate) || SWRL.inNamespace(predicate) || SWRLB.inNamespace(predicate); }
/** * Checks if is general predicate. * * @param predicate the predicate * @return true, if is general predicate */ protected static boolean isGeneralPredicate(IRI predicate) { return !predicate.isReservedVocabulary() || BUILT_IN_AP_IRIS.contains(predicate) || SWRL.inNamespace(predicate) || SWRLB.inNamespace(predicate); }
@Override public boolean canHandle(IRI s, IRI p, IRI o) { return !consumer.isAxiom(s) && !consumer.isAnnotation(s) && (BUILT_IN_AP_IRIS.contains(p) || !p.isReservedVocabulary()); }
protected void reservedForVersionIRI(OWLOntologyID id) { if (id.isAnonymous()) { return; } Optional<IRI> vIRI = id.getVersionIRI(); if (vIRI.isPresent() && vIRI.get().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForVersionIRI(getCurrentOntology())); } }
protected void reservedForOntologyIRI(OWLOntologyID id) { if (id.isAnonymous()) { return; } Optional<IRI> oIRI = id.getOntologyIRI(); if (oIRI.isPresent() && oIRI.get().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForOntologyIRI(getCurrentOntology())); } }
protected void reservedForDatatype(OWLDatatypeDefinitionAxiom axiom) { if (axiom.getDatatype().getIRI().isReservedVocabulary()) { violations .add(new UseOfBuiltInDatatypeInDatatypeDefinition(getCurrentOntology(), axiom)); } }
@Override public boolean canHandle(IRI subject, IRI predicate, IRI object) { boolean builtInAnnotationProperty = OWLRDFVocabulary.BUILT_IN_ANNOTATION_PROPERTY_IRIS.contains(predicate); return !getConsumer().isUnrecognisedRdfTypeAxiom(subject) && !getConsumer().isAnnotation(subject) && (builtInAnnotationProperty || !predicate.isReservedVocabulary()); }
protected void reservedForAnnotation(OWLAnnotationProperty property) { if (!property.isBuiltIn() && property.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForAnnotationPropertyIRI(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void reservedForClass(OWLClass ce) { if (!ce.isBuiltIn() && ce.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForClassIRI(getCurrentOntology(), getCurrentAxiom(), ce)); } }
protected void reservedForClass(OWLClass ce) { if (!ce.isBuiltIn() && ce.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForClassIRI(getCurrentOntology(), getCurrentAxiom(), ce)); } }
protected void reservedForIndividual(OWLNamedIndividual individual) { if (individual.isNamed() && individual.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForIndividualIRI(getCurrentOntology(), getCurrentAxiom(), individual)); } }
protected void reservedForDataProperty(OWLDataProperty property) { if (!property.isOWLTopDataProperty() && !property.isOWLBottomDataProperty() && property.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForDataPropertyIRI(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void reservedForObjectProperty(OWLObjectProperty property) { if (!property.isOWLTopObjectProperty() && !property.isOWLBottomObjectProperty() && property.getIRI().isReservedVocabulary()) { violations.add(new UseOfReservedVocabularyForObjectPropertyIRI(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredDataProperty(OWLDataProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add( new UseOfUndeclaredDataProperty(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredObjectProperty(OWLObjectProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add(new UseOfUndeclaredObjectProperty(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredObjectProperty(OWLObjectProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add(new UseOfUndeclaredObjectProperty(getCurrentOntology(), getCurrentAxiom(), property)); } }
protected void undeclaredClass(OWLClass ce) { if (!ce.isBuiltIn() && !ce.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(ce, INCLUDED)) { violations.add(new UseOfUndeclaredClass(getCurrentOntology(), getCurrentAxiom(), ce)); } }
protected void undeclaredAnnotation(OWLAnnotationProperty property) { if (!property.isBuiltIn() && !property.getIRI().isReservedVocabulary() && !getCurrentOntology().isDeclared(property, INCLUDED)) { violations.add(new UseOfUndeclaredAnnotationProperty(getCurrentOntology(), getCurrentAxiom(), getCurrentAnnotation(), property)); } }
protected void unknownDatatype(OWLDatatype node) { if (!Namespaces.XSD.inNamespace(node.getIRI()) && !node.isBuiltIn() && !node.isTopDatatype() && node.getIRI().isReservedVocabulary()) { violations.add(new UseOfUnknownDatatype(getCurrentOntology(), getCurrentAxiom(), node)); } }