@Deprecated public static Predicate.COL_TYPE getType(OWLDatatype owlDatatype) throws TranslationException { if (owlDatatype == null) return COL_TYPE.LITERAL; return getType(owlDatatype.getBuiltInDatatype()); }
@Override public boolean matches(@Nonnull OWLLiteral value) { OWLDatatype datatype = value.getDatatype(); if(datatype.isBuiltIn()) { OWL2Datatype builtInDatatype = datatype.getBuiltInDatatype(); Pattern pattern = builtInDatatype.getPattern(); return pattern.matcher(value.getLiteral()).matches(); } else { return true; } } }
@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; } } }
protected void illegalFacet(OWLDatatypeRestriction node, OWLDatatype datatype, OWLFacetRestriction r) { OWL2Datatype dt = datatype.getBuiltInDatatype(); if (!dt.getFacets().contains(r.getFacet())) { violations.add(new UseOfIllegalFacetRestriction(getCurrentOntology(), getCurrentAxiom(), node, r.getFacet())); } }
protected void illegalFacet(OWLDatatypeRestriction node, OWLDatatype datatype, OWLFacetRestriction r) { OWL2Datatype dt = datatype.getBuiltInDatatype(); if (!dt.getFacets().contains(r.getFacet())) { violations.add(new UseOfIllegalFacetRestriction(getCurrentOntology(), getCurrentAxiom(), node, r.getFacet())); } }
/** * @param c C * @param n cardinality * @return true if #C^I > n */ private boolean isCardLargerThan(OWLObject c, int n) { if (n == 0) { return isBotDistinct(c); } if (c instanceof OWLDatatype) { return ((OWLDatatype) c).isBuiltIn() && !((OWLDatatype) c).getBuiltInDatatype() .isFinite(); } // FIXME!! try to be more precise return false; }
/** * @param c C * @param n cardinality * @return true if #C^I > n */ private boolean isCardLargerThan(OWLObject c, int n) { if (n == 0) { return isBotDistinct(c); } if (c instanceof OWLDatatype) { return ((OWLDatatype) c).isBuiltIn() && !((OWLDatatype) c).getBuiltInDatatype() .isFinite(); } // FIXME!! try to be more precise return false; }
/** * @param c C * @param n cardinality * @return true if #C^I > n */ private boolean isCardLargerThan(OWLObject c, int n) { if (n == 0) { return isBotDistinct(c); } if (c instanceof OWLDatatype) { return ((OWLDatatype) c).isBuiltIn() && !((OWLDatatype) c).getBuiltInDatatype() .isFinite(); } // FIXME!! try to be more precise return false; }
protected void illegalFacet(OWLDatatypeRestriction node, OWLDatatype datatype, OWLFacetRestriction r) { OWL2Datatype dt = datatype.getBuiltInDatatype(); if (!dt.getFacets().contains(r.getFacet())) { violations.add(new UseOfIllegalFacetRestriction(getCurrentOntology(), getCurrentAxiom(), node, r.getFacet())); } }
/** * @param c C * @param n cardinality * @return true if #C^I > n */ private boolean isCardLargerThan(OWLObject c, int n) { if (n == 0) { return isBotDistinct(c); } if (c instanceof OWLDatatype) { return ((OWLDatatype) c).isBuiltIn() && !((OWLDatatype) c).getBuiltInDatatype() .isFinite(); } // FIXME!! try to be more precise return false; }
/** * cardinality of a concept/data expression interpretation * * @param c class * @param n cardinality * @return true if #C^I > n */ private boolean isCardLargerThan(OWLObject c, int n) { if (n == 0) { return isBotDistinct(c); } if (c instanceof OWLDatatype) { return ((OWLDatatype) c).isBuiltIn() && !((OWLDatatype) c).getBuiltInDatatype() .isFinite(); } // FIXME!! try to be more precise return false; }
/** * cardinality of a concept/data expression interpretation * * @param c class * @param n cardinality * @return true if #C^I > n */ private boolean isCardLargerThan(OWLObject c, int n) { if (n == 0) { return isBotDistinct(c); } if (c instanceof OWLDatatype) { return ((OWLDatatype) c).isBuiltIn() && !((OWLDatatype) c).getBuiltInDatatype() .isFinite(); } // FIXME!! try to be more precise return false; }
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 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()); }
protected boolean isBuiltin(OWLLiteral node) { return node.getDatatype().isBuiltIn() && !node.getDatatype().getBuiltInDatatype().isInLexicalSpace(node.getLiteral()); }
/** * Removes rdf:PlainLiteral. Also removes datatypes that should not be the concrete types of constants e.g. * owl:real. * @param datatypeComboBox The combobox from which the datatypes should be removed. Not {@code null}. */ private static void removeNonSelectableDatatypes(JComboBox<OWLDatatype> datatypeComboBox) { for (int i = 0; i < datatypeComboBox.getItemCount(); i++) { OWLDatatype datatype = datatypeComboBox.getItemAt(i); if (datatype != null) { if (datatype.isRDFPlainLiteral()) { datatypeComboBox.removeItemAt(i); } else if(datatype.isBuiltIn() && datatype.getBuiltInDatatype().equals(OWL2Datatype.OWL_REAL)) { datatypeComboBox.removeItemAt(i); } } } }
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; }
/** * This is a convenience method for determining whether a given data range expression is the top data range * or a built-in infinite datatype. This is used in the bottom- and top-equivalence evaluators * for treating cardinality restrictions. * * @param dataRange a data range expression * @return <code>true</code> if the specified data range expression is the top data range * or a built-in infinite datatype; <code>false</code> otherwise */ protected static boolean isTopEquivalentDataRange(OWLDataRange dataRange) { if (dataRange.isDatatype()){ OWLDatatype dataType = dataRange.asOWLDatatype(); return (dataType.isTopDatatype() || (dataType.isBuiltIn() && !dataType.getBuiltInDatatype().isFinite())); } else return false; }
/** * This is a convenience method for determining whether a given data range * expression is the top datatype or a built-in infinite datatype. This is * used in the bottom- and top-equivalence evaluators for treating * cardinality restrictions. * * @param dataRange a data range expression * @return {@code true} if the specified data range expression is the top datatype or a built-in * infinite datatype; {@code false} otherwise */ protected static boolean isTopOrBuiltInInfiniteDatatype(OWLDataRange dataRange) { if (dataRange.isOWLDatatype()) { OWLDatatype dataType = dataRange.asOWLDatatype(); return dataType.isTopDatatype() || dataType.isBuiltIn() && !dataType .getBuiltInDatatype().isFinite(); } else { return false; } }