/** * Tests to see if this entity is of the specified type. * * @param entityType The entity type * @return {@code true} if this entity is of the specified type, otherwise {@code false}. */ default boolean isType(EntityType<?> entityType) { return getEntityType().equals(entityType); }
/** * Tests to see if this entity is of the specified type. * * @param entityType The entity type * @return {@code true} if this entity is of the specified type, otherwise {@code false}. */ default boolean isType(EntityType<?> entityType) { return getEntityType().equals(entityType); }
/** * Tests to see if this entity is of the specified type. * * @param entityType The entity type * @return {@code true} if this entity is of the specified type, otherwise {@code false}. */ default boolean isType(EntityType<?> entityType) { return getEntityType().equals(entityType); }
@Nonnull @Override public String getMessage(ChangeApplicationResult<OWLEntity> result) { return "Deleted " + entity.getEntityType().getPrintName().toLowerCase(); } }
@SuppressWarnings("unchecked") private <E extends OWLEntity> Optional<E> getEntityOfTypeIfPresent(EntityType<E> entityType, String shortName) { return dictionaryManager .getEntities(shortName) .filter(entity -> entity.getEntityType().equals(entityType)) .map(entity -> (E) entity) .findFirst(); }
@Nonnull @Override public Matcher<OWLEntity> visit(@Nonnull EntityTypeIsOneOfCriteria criteria) { return entity -> criteria.getEntityTypes().contains(entity.getEntityType()); }
@Override public void serialize(OWLEntity entity, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeStartObject(); jsonGenerator.writeFieldName("type"); jsonGenerator.writeObject(entity.getEntityType()); jsonGenerator.writeFieldName("iri"); jsonGenerator.writeObject(entity.getIRI()); jsonGenerator.writeEndObject(); } }
public <E extends OWLEntity> E getRenamedEntity(E entity) { IRI renamedIRI = map.get(entity.getIRI()); if(renamedIRI == null) { return entity; } return (E) dataFactory.getOWLEntity(entity.getEntityType(), renamedIRI); }
@Override public String toString() { return toStringHelper("OWLEntityPrimitive") .add("type", entity.getEntityType().getName()) .add("iri", entity.getIRI().toString()) .toString(); }
@Override public void visit(OWLDeclarationAxiom axiom) { stringBuilder.append("<span class=\"section-kw\">"); stringBuilder.append(axiom.getEntity().getEntityType().getName()); stringBuilder.append(": "); stringBuilder.append("</span>"); axiom.getEntity().accept(this); renderAxiomAnnotations(axiom); }
@Nonnull @Override public String getMessage(ChangeApplicationResult<Boolean> result) { String type = action.getFromNodePath().getLast().map(node -> node.getEntity().getEntityType().getPrintName().toLowerCase()).orElse("entity"); String entity = action.getFromNodePath().getLast().map(EntityNode::getBrowserText).orElse(""); String from = action.getFromNodePath().getLastPredecessor().map(EntityNode::getBrowserText).orElse("root"); String to = action.getToNodeParentPath().getLast().map(EntityNode::getBrowserText).orElse("root"); return msg.format("Moved {0} {1} from {2} to {3}", type, entity, from, to); } }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderEntity(OWLEntity expected, OWLDataFactory df) { this(df); withType(expected.getEntityType()).withIRI(expected.getIRI()); }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderEntity(OWLEntity expected, OWLDataFactory df) { this(df); withType(expected.getEntityType()).withIRI(expected.getIRI()); }
@Override public DBObject convert(OWLEntity entity) { BasicDBObject basicDBObject = new BasicDBObject(); basicDBObject.put("type", entity.getEntityType().getName()); basicDBObject.put("iri", entity.getIRI().toString()); return basicDBObject; } }
@Override public DBObject encodeObject(OWLEntity entity, MappedField optionalExtraInfo) { BasicDBObject document = new BasicDBObject(); document.append(TYPE_PROPERTY_NAME, entity.getEntityType().getName()); document.append(IRI_PROPERTY_NAME, entity.getIRI().toString()); return document; } }
@Override public OWLClass deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { OWLEntity entity = deserializer.deserialize(jsonParser, deserializationContext); if(!entity.isOWLClass()) { throw new JsonParseException(jsonParser, "Expected an owl:Class but found an " + entity.getEntityType().getPrefixedName()); } return (OWLClass) entity; } }
@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()); }
private void writeFrameHeader(OWLEntity entity, StringBuilder builder) { frameHeaderTagRenderer.renderOpeningTag(builder); frameTypeTagRenderer.renderOpeningTag(builder); String frameName = entity.getEntityType().getName(); builder.append(frameName); builder.append(": "); frameTypeTagRenderer.renderClosingTag(builder); frameSubjectTagRenderer.renderOpeningTag(builder); renderEscaped(shortFormProvider.getShortForm(entity), builder); frameSubjectTagRenderer.renderClosingTag(builder); frameHeaderTagRenderer.renderClosingTag(builder); }
@Override public void visit(OWLDeclarationAxiom axiom) { addSingleTripleAxiom(axiom, axiom.getEntity(), RDF_TYPE.getIRI(), axiom.getEntity().getEntityType().getIRI()); }