@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
@Override public boolean isRDFPlainLiteral() { return getDatatype().isRDFPlainLiteral(); }
protected OWLLiteral getBasicLiteral(String lexicalValue, String lang, @Nullable OWLDatatype datatype) { if (useCompression) { if (datatype == null || datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { return new OWLLiteralImplPlain(lexicalValue, lang); } return new OWLLiteralImpl(lexicalValue, lang, datatype); } return new OWLLiteralImplNoCompression(lexicalValue, lang, datatype); }
protected OWLLiteral getBasicLiteral(String lexicalValue, String lang, @Nullable OWLDatatype datatype) { if (useCompression) { if (datatype == null || datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { return new OWLLiteralImplPlain(lexicalValue, lang); } return new OWLLiteralImpl(lexicalValue, lang, datatype); } return new OWLLiteralImplNoCompression(lexicalValue, lang, datatype); }
protected OWLLiteral getBasicLiteral(String lexicalValue, String lang, @Nullable OWLDatatype datatype) { if (useCompression) { if (datatype == null || datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { return new OWLLiteralImplPlain(lexicalValue, lang); } return new OWLLiteralImpl(lexicalValue, lang, datatype); } return new OWLLiteralImplNoCompression(lexicalValue, lang, datatype); }
protected OWLLiteral getBasicLiteral(String lexicalValue, String lang, @Nullable OWLDatatype datatype) { if (useCompression) { if (datatype == null || datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { return new OWLLiteralImplPlain(lexicalValue, lang); } return new OWLLiteralImpl(lexicalValue, lang, datatype); } return new OWLLiteralImplNoCompression(lexicalValue, lang, datatype); }
@Override public void visit(OWLDatatype node) { if(ignoreGenericTypeStatements && !node.isRDFPlainLiteral() && !node.isTopDatatype()){ sparql += "FILTER(DATATYPE(" + variables.peek() + "=<" + node.getIRI().toString() + ">))"; } }
@Override public OWLLiteral getOWLLiteral(String lexicalValue, OWLDatatype datatype) { if (datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { int sep = lexicalValue.lastIndexOf('@'); if (sep != -1) { String lex = lexicalValue.substring(0, sep); String lang = lexicalValue.substring(sep + 1); return verifyNotNull(getBasicLiteral(lex, lang, LANGSTRING)); } else { return verifyNotNull(getBasicLiteral(lexicalValue, XSDSTRING)); } } // check the special cases return verifyNotNull(parseSpecialCases(lexicalValue, datatype)); }
@Override public OWLLiteral getOWLLiteral(String lexicalValue, OWLDatatype datatype) { if (datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { int sep = lexicalValue.lastIndexOf('@'); if (sep != -1) { String lex = lexicalValue.substring(0, sep); String lang = lexicalValue.substring(sep + 1); return verifyNotNull(getBasicLiteral(lex, lang, LANGSTRING)); } else { return verifyNotNull(getBasicLiteral(lexicalValue, XSDSTRING)); } } // check the special cases return verifyNotNull(parseSpecialCases(lexicalValue, datatype)); }
@Override public OWLLiteral getOWLLiteral(String lexicalValue, OWLDatatype datatype) { if (datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { int sep = lexicalValue.lastIndexOf('@'); if (sep != -1) { String lex = lexicalValue.substring(0, sep); String lang = lexicalValue.substring(sep + 1); return verifyNotNull(getBasicLiteral(lex, lang, LANGSTRING)); } else { return verifyNotNull(getBasicLiteral(lexicalValue, XSDSTRING)); } } // check the special cases return verifyNotNull(parseSpecialCases(lexicalValue, datatype)); }
@Override public OWLLiteral getOWLLiteral(String lexicalValue, OWLDatatype datatype) { if (datatype.isRDFPlainLiteral() || datatype.equals(LANGSTRING)) { int sep = lexicalValue.lastIndexOf('@'); if (sep != -1) { String lex = lexicalValue.substring(0, sep); String lang = lexicalValue.substring(sep + 1); return verifyNotNull(getBasicLiteral(lex, lang, LANGSTRING)); } else { return verifyNotNull(getBasicLiteral(lexicalValue, XSDSTRING)); } } // check the special cases return verifyNotNull(parseSpecialCases(lexicalValue, datatype)); }
/** * 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); } } } }
/** * 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 static boolean isLiteralIsInLexicalSpace(OWLLiteral literal) { OWLDatatype d = literal.getDatatype(); if(d.isRDFPlainLiteral()) { return true; } if(d.isString()) { return true; } if(d.isBuiltIn()) { OWL2Datatype builtIn = d.getBuiltInDatatype(); if (builtIn.equals(OWL2Datatype.RDF_XML_LITERAL)) { return checkXMLLiteral(literal); } else { Pattern pattern = builtIn.getPattern(); return pattern.matcher(literal.getLiteral()).matches(); } } else { return true; } }