@Override public void visit(OWLDatatype dt) { if(dt.isBuiltIn()) { renamedOWLObject = dt; } else { renamedOWLObject = PatternConstants.USER_DEFINED_DATATYPE; } }
@Override public boolean matches(@Nonnull OWLLiteral lit) { if (lit.getDatatype().isBuiltIn()) { OWL2Datatype datatype = lit.getDatatype().getBuiltInDatatype(); return !datatype.getPattern().matcher(lit.getLiteral()).matches(); } else { return false; } } }
/** * @param expr data range to check * @return true iff EXPR is a top datatype or a built-in datatype; */ public boolean isTopOrBuiltInDataType(OWLDataRange expr) { return expr.isTopDatatype() || expr.isOWLDatatype() && expr.asOWLDatatype().isBuiltIn(); }
/** * @param expr data range to check * @return true iff EXPR is a top datatype or a built-in datatype; */ public boolean isTopOrBuiltInDataType(OWLDataRange expr) { return expr.isTopDatatype() || expr.isOWLDatatype() && expr.asOWLDatatype().isBuiltIn(); }
/** * @param expr data range to check * @return true iff EXPR is a top datatype or a built-in datatype; */ public boolean isTopOrBuiltInDataType(OWLDataRange expr) { return expr.isTopDatatype() || expr.isOWLDatatype() && expr.asOWLDatatype().isBuiltIn(); }
/** * @param expr data range to check * @return true iff EXPR is a top datatype or a built-in datatype; */ public boolean isTopOrBuiltInDataType(OWLDataRange expr) { return expr.isTopDatatype() || expr.isOWLDatatype() && expr.asOWLDatatype().isBuiltIn(); }
protected void notInLexicalSpace(OWLLiteral node) { if (!node.getDatatype().isBuiltIn()) { violations.add( new UseOfDefinedDatatypeInLiteral(getCurrentOntology(), getCurrentAxiom(), node)); } // Check that the lexical value of the literal is in the lexical // space of the literal datatype if (isBuiltin(node)) { violations .add(new LexicalNotInLexicalSpace(getCurrentOntology(), getCurrentAxiom(), node)); } }
protected void undeclaredDatatype(OWLDatatype dt) { if (!dt.isTopDatatype() && !dt.isBuiltIn() && !getCurrentOntology().isDeclared(dt, Imports.INCLUDED)) { violations .add(new UseOfUndeclaredDatatype(getCurrentOntology(), getCurrentAxiom(), dt)); } }
protected void undeclaredDatatype(OWLDatatype dt) { if (!dt.isTopDatatype() && !dt.isBuiltIn() && !getCurrentOntology().isDeclared(dt, Imports.INCLUDED)) { violations .add(new UseOfUndeclaredDatatype(getCurrentOntology(), getCurrentAxiom(), dt)); } }
protected void undeclaredDatatype(OWLDatatype dt) { if (!dt.isTopDatatype() && !dt.isBuiltIn() && !getCurrentOntology().isDeclared(dt, Imports.INCLUDED)) { violations .add(new UseOfUndeclaredDatatype(getCurrentOntology(), getCurrentAxiom(), dt)); } }
protected void notInLexicalSpace(OWLLiteral node) { if (!node.getDatatype().isBuiltIn()) { violations.add( new UseOfDefinedDatatypeInLiteral(getCurrentOntology(), getCurrentAxiom(), node)); } // Check that the lexical value of the literal is in the lexical // space of the literal datatype if (isBuiltin(node)) { violations .add(new LexicalNotInLexicalSpace(getCurrentOntology(), getCurrentAxiom(), node)); } }
protected void notInLexicalSpace(OWLLiteral node) { if (!node.getDatatype().isBuiltIn()) { violations.add( new UseOfDefinedDatatypeInLiteral(getCurrentOntology(), getCurrentAxiom(), node)); } // Check that the lexical value of the literal is in the lexical // space of the literal datatype if (isBuiltin(node)) { violations .add(new LexicalNotInLexicalSpace(getCurrentOntology(), getCurrentAxiom(), node)); } }
protected boolean isBuiltin(OWLLiteral node) { return node.getDatatype().isBuiltIn() && !node.getDatatype().getBuiltInDatatype().isInLexicalSpace(node.getLiteral()); }
protected boolean isBuiltin(OWLLiteral node) { return node.getDatatype().isBuiltIn() && !node.getDatatype().getBuiltInDatatype().isInLexicalSpace(node.getLiteral()); }
public AttributeType<?> resourceType(OWLDataProperty property) { OWL2Datatype propertyType= eval(() -> { Optional<OWLDataPropertyRangeAxiom> ax = ontology.dataPropertyRangeAxioms(property) .filter(rangeAxiom -> rangeAxiom.getRange().isOWLDatatype() && rangeAxiom.getRange().asOWLDatatype().isBuiltIn()) .findFirst(); return ax.isPresent() ? ax.get().getRange().asOWLDatatype().getBuiltInDatatype() : null; }); AttributeType.DataType<?> graknType = propertyType == null ? AttributeType.DataType.STRING : owlBuiltInToGraknDatatype(propertyType); AttributeType<?> attributeType = tx.putAttributeType(namer.fromIri(property.getIRI()), graknType); return attributeType; }
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)); } }
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)); } }
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)); } }
public Object visit(OWLTypedLiteral node) { // Check that the lexical value of the literal is in the lexical space of the // literal datatype if (node.getDatatype().isBuiltIn()) { if (!node.getDatatype().getBuiltInDatatype().isInLexicalSpace(node.getLiteral())) { profileViolations.add(new LexicalNotInLexicalSpace(getCurrentOntology(), getCurrentAxiom(), node)); } } return null; }
public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException { if (!getConsumer().isAnonymousNode(subject)) { OWLDatatype dt = getDataFactory().getOWLDatatype(subject); if (!dt.isBuiltIn()) { addAxiom(getDataFactory().getOWLDeclarationAxiom(dt)); } } getConsumer().addOWLDatatype(subject); } }