/** * 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; } }
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; } }