/** * Checks if this entity is referred by a logical axiom in the imports * closure of the designated ontology. * @param entity entity we are searching for * @return <code>true</code> if there is at least one logical axiom in the * imports closure of the given ontology that refers the given * entity */ public boolean isDefined(OWLEntity entity) { return entity.isBuiltIn() || referenceCounts.containsKey(entity); }
@Nonnull @Override public Matcher<OWLEntity> visit(@Nonnull IsNotBuiltInEntityCriteria criteria) { return entity -> !entity.isBuiltIn(); }
/** * Checks if this entity is referred by a logical axiom in the imports * closure of the designated ontology. * * @param entity entity we are searching for * @return {@code true} if there is at least one logical axiom in the imports closure of the * given ontology that refers the given entity */ public boolean isDefined(OWLEntity entity) { return checkNotNull(entity, "entity cannot be null").isBuiltIn() || referenceCounts .containsKey(entity); }
/** * Checks if this entity is referred by a logical axiom in the imports * closure of the designated ontology. * * @param entity entity we are searching for * @return {@code true} if there is at least one logical axiom in the imports closure of the * given ontology that refers the given entity */ public boolean isDefined(OWLEntity entity) { return checkNotNull(entity, "entity cannot be null").isBuiltIn() || referenceCounts .containsKey(entity); }
/** * Checks if this entity is referred by a logical axiom in the imports * closure of the designated ontology. * * @param entity entity we are searching for * @return {@code true} if there is at least one logical axiom in the imports closure of the * given ontology that refers the given entity */ public boolean isDefined(OWLEntity entity) { return checkNotNull(entity, "entity cannot be null").isBuiltIn() || referenceCounts .containsKey(entity); }
/** * Checks if this entity is referred by a logical axiom in the imports * closure of the designated ontology. * * @param entity entity we are searching for * @return {@code true} if there is at least one logical axiom in the imports closure of the * given ontology that refers the given entity */ public boolean isDefined(OWLEntity entity) { return checkNotNull(entity, "entity cannot be null").isBuiltIn() || referenceCounts .containsKey(entity); }
/** * Removes an entity and its short form from the cache. Only non-BuiltIn entities are removed. * * @param entity The entity to be removed. The entity will only be removed if {@code OWLEntity.isBuiltIn} returns * {@code false}. */ @Override public void remove(OWLEntity entity) { if (!entity.isBuiltIn()) { super.remove(entity); } } }
public String getName(OWLEntity entity) { if (entity.isBuiltIn()) { return entity.getIRI().toString(); } entity.accept(this); return name; }
private boolean datatypesMightHaveChanged(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (change instanceof OWLAxiomChange) { for (OWLEntity e : change.getAxiom().getSignature()) { if (e instanceof OWLDatatype && !e.isBuiltIn()) { return true; } } } } return false; }
private boolean datatypesMightHaveChanged(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (change instanceof OWLAxiomChange) { for (OWLEntity e : change.getAxiom().getSignature()) { if (e instanceof OWLDatatype && !e.isBuiltIn()) { return true; } } } } return false; }
private boolean datatypesMightHaveChanged(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (change instanceof OWLAxiomChange) { for (OWLEntity e : ((OWLAxiomChange) change).getAxiom().getSignature()) { if (e instanceof OWLDatatype && !e.isBuiltIn()) { return true; } } } } return false; }
/** * @param entity entity to rename * @return new name */ public String getName(OWLEntity entity) { if (entity.isBuiltIn()) { return entity.getIRI().toString(); } return entity.accept(this); }
/** * @param entity entity to rename * @return new name */ public String getName(OWLEntity entity) { if (entity.isBuiltIn()) { return entity.getIRI().toString(); } return entity.accept(this); }
/** * @param entity entity to rename * @return new name */ public String getName(OWLEntity entity) { if (entity.isBuiltIn()) { return entity.getIRI().toString(); } return entity.accept(this); }
private void writeDeclarations(OWLEntity entity, Set<OWLAxiom> alreadyWrittenAxioms, Collection<IRI> illegals) { Collection<OWLDeclarationAxiom> axioms = asList(ont.declarationAxioms(entity).sorted()); axioms.stream().filter(alreadyWrittenAxioms::add).forEach(this::acceptAndReturn); // if multiple illegal declarations already exist, they have already // been outputted the renderer cannot take responsibility for removing // them. It should not add declarations for illegally punned entities // here, though if (addMissingDeclarations && axioms.isEmpty() && !entity.isBuiltIn() && !illegals.contains(entity.getIRI()) && !ont.isDeclared(entity, Imports.INCLUDED)) { OWLDeclarationAxiom declaration = ont.getOWLOntologyManager().getOWLDataFactory().getOWLDeclarationAxiom(entity); acceptAndReturn(declaration); } }
private void writeDeclarations(OWLEntity entity, Set<OWLAxiom> alreadyWrittenAxioms, Collection<IRI> illegals) { Collection<OWLDeclarationAxiom> axioms = asList(ont.declarationAxioms(entity).sorted()); axioms.stream().filter(alreadyWrittenAxioms::add).forEach(this::acceptAndReturn); // if multiple illegal declarations already exist, they have already // been outputted the renderer cannot take responsibility for removing // them. It should not add declarations for illegally punned entities // here, though if (addMissingDeclarations && axioms.isEmpty() && !entity.isBuiltIn() && !illegals.contains(entity.getIRI()) && !ont.isDeclared(entity, Imports.INCLUDED)) { OWLDeclarationAxiom declaration = ont.getOWLOntologyManager().getOWLDataFactory().getOWLDeclarationAxiom(entity); acceptAndReturn(declaration); } }
private void writeDeclarations(OWLEntity entity, Set<OWLAxiom> alreadyWrittenAxioms, Collection<IRI> illegals) { Collection<OWLDeclarationAxiom> axioms = asList(ont.declarationAxioms(entity).sorted()); axioms.stream().filter(alreadyWrittenAxioms::add).forEach(this::acceptAndReturn); // if multiple illegal declarations already exist, they have already // been outputted the renderer cannot take responsibility for removing // them. It should not add declarations for illegally punned entities // here, though if (addMissingDeclarations && axioms.isEmpty() && !entity.isBuiltIn() && !illegals.contains(entity.getIRI()) && !ont.isDeclared(entity, Imports.INCLUDED)) { OWLDeclarationAxiom declaration = ont.getOWLOntologyManager().getOWLDataFactory().getOWLDeclarationAxiom(entity); acceptAndReturn(declaration); } }
/** * Adds triples to strong type an entity. Triples are only added if the useStrongTyping flag * is set to <code>true</code> 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 (entity.isBuiltIn()) { return; } addTriple(entity, RDF_TYPE.getIRI(), entity.accept(OWLEntityTypeProvider.INSTANCE)); }
public IRI generateNewIRI(OWLEntity entity) { if(entity.isBuiltIn()) { return entity.getIRI(); } IRI base = getBaseIRI(entity); String id = ""; // this is the "user given name" which will not be used OWLEntity newEntity = getEntity(entity, id, base); return newEntity.getIRI(); }
public IRI generateNewIRI(OWLEntity entity) { if(entity.isBuiltIn()) { return entity.getIRI(); } IRI base = getBaseIRI(entity); String id = ""; // this is the "user given name" which will not be used OWLEntity newEntity = getEntity(entity, id, base); return newEntity.getIRI(); }