/** * Adds triples to strong type an entity. Triples are only added if the useStrongTyping flag is * set to {@code true} and the entity is not a built in entity. * * @param entity The entity for which strong typing triples should be added. */ private void addStrongTyping(OWLEntity entity) { if (!useStrongTyping) { return; } if (!OWLDocumentFormat.isMissingType(entity, ont)) { return; } addTriple(entity, RDF_TYPE.getIRI(), entity.getEntityType().getIRI()); }
/** * Adds triples to strong type an entity. Triples are only added if the useStrongTyping flag is * set to {@code true} and the entity is not a built in entity. * * @param entity The entity for which strong typing triples should be added. */ private void addStrongTyping(OWLEntity entity) { if (!useStrongTyping) { return; } if (!OWLDocumentFormat.isMissingType(entity, ont)) { return; } addTriple(entity, RDF_TYPE.getIRI(), entity.getEntityType().getIRI()); }
/** * Adds triples to strong type an entity. Triples are only added if the useStrongTyping flag is * set to {@code true} and the entity is not a built in entity. * * @param entity The entity for which strong typing triples should be added. */ private void addStrongTyping(OWLEntity entity) { if (!useStrongTyping) { return; } if (!OWLDocumentFormat.isMissingType(entity, ont)) { return; } addTriple(entity, RDF_TYPE.getIRI(), entity.getEntityType().getIRI()); }
/** * Adds triples to strong type an entity. Triples are only added if the useStrongTyping flag is * set to {@code true} and the entity is not a built in entity. * * @param entity The entity for which strong typing triples should be added. */ private void addStrongTyping(OWLEntity entity) { if (!useStrongTyping) { return; } if (!OWLDocumentFormat.isMissingType(entity, ont)) { return; } addTriple(entity, RDF_TYPE.getIRI(), entity.getEntityType().getIRI()); }
@Override public void visit(OWLDeclarationAxiom axiom) { addSingleTripleAxiom(axiom, axiom.getEntity(), RDF_TYPE.getIRI(), axiom.getEntity().getEntityType().getIRI()); }
@Override public void visit(OWLDeclarationAxiom axiom) { addSingleTripleAxiom(axiom, axiom.getEntity(), RDF_TYPE.getIRI(), axiom.getEntity().getEntityType().getIRI()); }
/** * Returns the entity type of the given resource IRI, i.e. whether the resource * is a owl:Class, owl:ObjectProperty,owl:DatatypeProperty or owl:NamedIndividual. * @param iri the IRI of the entity * @return the entity type */ public EntityType<? extends OWLEntity> getOWLEntityType(String iri) { ParameterizedSparqlString query = new ParameterizedSparqlString("SELECT ?type WHERE {?s a ?type .}"); query.setIri("s", iri); ResultSet rs = executeSelectQuery(query.toString()); Set<EntityType<? extends OWLEntity>> entityTypes = new HashSet<>(); while(rs.hasNext()){ QuerySolution qs = rs.next(); String uri = qs.getResource("type").getURI(); for(EntityType<? extends OWLEntity> entityType : EntityType.values()){ if(entityType.getIRI().toString().equals(uri)){ entityTypes.add(entityType); break; } } } if(entityTypes.size() == 1){ return entityTypes.iterator().next(); } return null; }
@Override public void visit(OWLDeclarationAxiom axiom) { addSingleTripleAxiom(axiom, axiom.getEntity(), RDF_TYPE.getIRI(), axiom.getEntity().getEntityType().getIRI()); }
@Override public void visit(OWLDeclarationAxiom axiom) { addSingleTripleAxiom(axiom, axiom.getEntity(), RDF_TYPE.getIRI(), axiom.getEntity().getEntityType().getIRI()); }