public OWLDatatypeImpl(OWLDataFactory dataFactory, IRI iri) { super(dataFactory); this.iri = iri; top = getURI().equals(OWLRDFVocabulary.RDFS_LITERAL.getURI()); builtin = OWL2Datatype.isBuiltIn(getIRI()) | top; }
private static boolean isRenderableAsNumber(@Nonnull OWLLiteral literal) { var datatypeIRI = literal.getDatatype().getIRI(); if(OWL2Datatype.isBuiltIn(datatypeIRI)) { var datatype = OWL2Datatype.getDatatype(datatypeIRI); return datatype.isNumeric(); } return false; }
/** * @param iri * datatype iri */ public OWLDatatypeImpl(@Nonnull IRI iri) { this.iri = checkNotNull(iri, "iri cannot be null"); top = iri.equals(OWLRDFVocabulary.RDFS_LITERAL.getIRI()); builtin = top || OWL2Datatype.isBuiltIn(iri) || iri.equals(OWLRDFVocabulary.RDF_PLAIN_LITERAL.getIRI()); }
/** * Given a URI that identifies an OWLDatatype, this method obtains the * corresponding OWLDatatypeVocabulary * @param datatype The datatype URI * @return The OWLDatatypeVocabulary * @throws OWLRuntimeException if the specified URI is not a built in datatype URI */ public static OWL2Datatype getDatatype(IRI datatype) { if (!isBuiltIn(datatype)) { throw new OWLRuntimeException(datatype + " is not a built in datatype!"); } for (OWL2Datatype v : values()) { if (v.getIRI().equals(datatype)) { return v; } } throw new OWLRuntimeException(datatype + " is not a built in datatype!"); }
@SuppressWarnings("javadoc") public OWLDatatypeImpl( IRI iri) { super(); this.iri = iri; top = iri.equals(OWLRDFVocabulary.RDFS_LITERAL.getIRI()); builtin = top || OWL2Datatype.isBuiltIn(iri) || iri.equals(OWLRDFVocabulary.RDF_PLAIN_LITERAL.getIRI()); }
/** * Given an IRI that identifies an {@link OWLDatatype}, this method obtains * the corresponding {@code OWL2Datatype}. * * @param datatype * The datatype IRI. Not {@code null}. * @return The {@code OWL2Datatype} that has the specified {@link IRI}. * @throws OWLRuntimeException * if the specified IRI is not a built in datatype IRI. */ @Nonnull public static OWL2Datatype getDatatype(IRI datatype) { if (!isBuiltIn(datatype)) { throw new OWLRuntimeException(datatype + " is not a built in datatype!"); } for (OWL2Datatype v : values()) { if (v.iri.equals(datatype)) { return v; } } throw new OWLRuntimeException(datatype + " is not a built in datatype!"); }
/** * @param iri datatype iri */ public OWLDatatypeImpl(IRI iri) { this.iri = checkNotNull(iri, "iri cannot be null"); top = iri.equals(OWLRDFVocabulary.RDFS_LITERAL.getIRI()); builtin = top || OWL2Datatype.isBuiltIn(iri) || iri .equals(OWLRDFVocabulary.RDF_PLAIN_LITERAL.getIRI()); }
/** * @param iri datatype iri */ public OWLDatatypeImpl(IRI iri) { this.iri = checkNotNull(iri, "iri cannot be null"); top = iri.equals(OWLRDFVocabulary.RDFS_LITERAL.getIRI()); builtin = top || OWL2Datatype.isBuiltIn(iri) || iri .equals(OWLRDFVocabulary.RDF_PLAIN_LITERAL.getIRI()); }
/** * @param iri datatype iri */ public OWLDatatypeImpl(IRI iri) { this.iri = checkNotNull(iri, "iri cannot be null"); top = iri.equals(OWLRDFVocabulary.RDFS_LITERAL.getIRI()); builtin = top || OWL2Datatype.isBuiltIn(iri) || iri .equals(OWLRDFVocabulary.RDF_PLAIN_LITERAL.getIRI()); }
/** * @param iri datatype iri */ public OWLDatatypeImpl(IRI iri) { this.iri = checkNotNull(iri, "iri cannot be null"); top = iri.equals(OWLRDFVocabulary.RDFS_LITERAL.getIRI()); builtin = top || OWL2Datatype.isBuiltIn(iri) || iri .equals(OWLRDFVocabulary.RDF_PLAIN_LITERAL.getIRI()); }
/** * Given an IRI that identifies an {@link org.semanticweb.owlapi.model.OWLDatatype}, this method obtains the * corresponding {@link OWL2Datatype}. * @param datatype The datatype IRI. Not {@code null}. * @return The {@link OWL2Datatype} that has the specified {@link IRI}. * @throws OWLRuntimeException if the specified IRI is not a built in datatype IRI. */ public static OWL2Datatype getDatatype(IRI datatype) { if (!isBuiltIn(datatype)) { throw new OWLRuntimeException(datatype + " is not a built in datatype!"); } for (OWL2Datatype v : values()) { if (v.iri.equals(datatype)) { return v; } } throw new OWLRuntimeException(datatype + " is not a built in datatype!"); }
public Object visit(OWLDatatype datatype) { // Each datatype MUST statisfy the following: // An IRI used to identify a datatype MUST // - Identify a datatype in the OWL 2 datatype map (Section 4.1 lists them), or // - Have the xsd: prefix, or // - Be rdfs:Literal, or // - Not be in the reserved vocabulary of OWL 2 if (!OWL2Datatype.isBuiltIn(datatype.getIRI())) { if (!datatype.getIRI().toString().startsWith(Namespaces.XSD.toString())) { if (!datatype.isTopDatatype()) { if (datatype.getIRI().isReservedVocabulary()) { profileViolations.add(new UseOfUnknownDatatype(getCurrentOntology(), getCurrentAxiom(), datatype)); } } } // We also have to declare datatypes that are not built in if (!datatype.isTopDatatype() && datatype.isBuiltIn() && getCurrentOntology().isDeclared(datatype, true)) { profileViolations.add(new UseOfUndeclaredDatatype(getCurrentOntology(), getCurrentAxiom(), datatype)); } } if (getCurrentOntology().containsClassInSignature(datatype.getIRI(), true)) { profileViolations.add(new DatatypeIRIAlsoUsedAsClassIRI(getCurrentOntology(), getCurrentAxiom(), datatype.getIRI())); } return null; }
OWLDatatype datatype = owlLiteral.getDatatype(); IRI dataTypeIri = datatype.getIRI(); if (!OWL2Datatype.isBuiltIn(dataTypeIri)) { error("Untranslatable axiom due to unknown data type: "+annVal); return false;
OWLDatatype datatype = owlLiteral.getDatatype(); IRI dataTypeIri = datatype.getIRI(); if (!OWL2Datatype.isBuiltIn(dataTypeIri)) { error("Untranslatable axiom due to unknown data type: " + annVal, true); return false;
OWLDatatype datatype = owlLiteral.getDatatype(); IRI dataTypeIri = datatype.getIRI(); if (!OWL2Datatype.isBuiltIn(dataTypeIri)) { error("Untranslatable axiom due to unknown data type: " + annVal, true); return false;
OWLDatatype datatype = owlLiteral.getDatatype(); IRI dataTypeIri = datatype.getIRI(); if (!OWL2Datatype.isBuiltIn(dataTypeIri)) { error("Untranslatable axiom due to unknown data type: " + annVal, true); return false;
OWLDatatype datatype = owlLiteral.getDatatype(); IRI dataTypeIri = datatype.getIRI(); if (!OWL2Datatype.isBuiltIn(dataTypeIri)) { error("Untranslatable axiom due to unknown data type: " + annVal, true); return false;