@Override public void statementWithResourceValue(String subject, String predicate, String object) { if (ontologyProperties.contains(predicate)) { notPossibleOntologyNames.add(object); possibleOntologyNames.remove(object); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals("http://www.w3.org/2002/07/owl#OntologyProperty")) { ontologyProperties.add(subject); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals(OWLRDFVocabulary.OWL_ONTOLOGY.toString()) && !notPossibleOntologyNames.contains(subject)) { possibleOntologyNames.add(subject); } else if (predicate.equals(OWLRDFVocabulary.OWL_VERSION_IRI.toString())) { nameToVersionMap.put(subject, object); } }
public void statementWithResourceValue(String subject, String predicate, String object) throws SAXException { if (ontologyProperties.contains(predicate)) { notPossibleOntologyNames.add(object); possibleOntologyNames.remove(object); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals("http://www.w3.org/2002/07/owl#OntologyProperty")) { ontologyProperties.add(subject); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals(OWLRDFVocabulary.OWL_ONTOLOGY.toString()) && !notPossibleOntologyNames.contains(subject)) { possibleOntologyNames.add(subject); } else if (predicate.equals(OWLRDFVocabulary.OWL_VERSION_IRI.toString())) { nameToVersionMap.put(subject, object); } }
public void statementWithResourceValue(String subject, String predicate, String object) throws SAXException { if (ontologyProperties.contains(predicate)) { notPossibleOntologyNames.add(object); possibleOntologyNames.remove(object); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals("http://www.w3.org/2002/07/owl#OntologyProperty")) { ontologyProperties.add(subject); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals(OWLRDFVocabulary.OWL_ONTOLOGY.toString()) && !notPossibleOntologyNames.contains(subject)) { possibleOntologyNames.add(subject); } else if (predicate.equals(OWLRDFVocabulary.OWL_VERSION_IRI.toString())) { nameToVersionMap.put(subject, object); } }
@Override public void statementWithResourceValue(String subject, String predicate, String object) { if (ontologyProperties.contains(predicate)) { notPossibleOntologyNames.add(object); possibleOntologyNames.remove(object); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals("http://www.w3.org/2002/07/owl#OntologyProperty")) { ontologyProperties.add(subject); } else if (predicate.equals(OWLRDFVocabulary.RDF_TYPE.toString()) && object.equals(OWLRDFVocabulary.OWL_ONTOLOGY.toString()) && !notPossibleOntologyNames.contains(subject)) { possibleOntologyNames.add(subject); } else if (predicate.equals(OWLRDFVocabulary.OWL_VERSION_IRI.toString())) { nameToVersionMap.put(subject, object); } }
public String getLabel(OWLEntity entity) { for (String annotation : getAnnotation(entity, OWLRDFVocabulary.RDFS_LABEL.toString())) { return annotation; } return StringUtils.EMPTY; }
public OWLAnnotation createDefinitionAnnotation(String definition) { return createAnnotation(definition, OWLRDFVocabulary.RDFS_COMMENT.toString()); }
static boolean isDeprecated(Node n) { if (!n.hasProperty(OWLRDFVocabulary.OWL_DEPRECATED.toString())) { return false; } if (n.getProperty(OWLRDFVocabulary.OWL_DEPRECATED.toString()) instanceof Boolean) { return (Boolean) n.getProperty(OWLRDFVocabulary.OWL_DEPRECATED.toString()); } else { return Boolean.valueOf((String)n.getProperty(OWLRDFVocabulary.OWL_DEPRECATED.toString(), "false")); } }
public OWLAnnotation createLabelAnnotation(String label) { return createAnnotation(label, OWLRDFVocabulary.RDFS_LABEL.toString()); }
public String getLabel(OWLEntity entity) { Set<String> annotation = getAnnotation(entity, OWLRDFVocabulary.RDFS_LABEL.toString()); if (!annotation.isEmpty()) { return annotation.iterator().next(); } else { return extractOWLClassId(entity); } }
private void clearEmptyAxiomStatements() { //Check and see if the model has any empty axiom statements and if so, remove them StmtIterator axiomStatements = filteredAssertionsModel.listStatements(null, RDF.type, ResourceFactory.createResource(OWL_AXIOM.toString())); List<Statement> removeStatements = new ArrayList<Statement>(); while(axiomStatements.hasNext()) { Statement axiomStatement = axiomStatements.nextStatement(); List<Statement> axiomSubjectStatements = filteredAssertionsModel.listStatements( axiomStatement.getSubject(), null, (RDFNode) null).toList(); //if no statements associated with axiom, then add for removal //TODO: Check to make sure the axiom statement is actually CORRECTLY formed as per the OWL api requirements if(axiomSubjectStatements.size() == 1) { removeStatements.add(axiomStatement); } } if(removeStatements.size() > 0) { log.warn("The following statements are empty axiom statements and have been removed" + removeStatements.toString()); //Remove the statements from the filtered model filteredAssertionsModel.remove(removeStatements); } else { log.debug("No empty axiom statements were found"); } }
deprecated = buildConcept("http://example.org/#cerebellum2", "Cerebellum", "baz", "foo"); GraphUtil.addProperty(graphDb.getNodeById(deprecated.getId()), OWLRDFVocabulary.OWL_DEPRECATED.toString(), "true"); tx.success();