private String getJavadoc(OWLEntity e) { StringBuffer sb = new StringBuffer(); Set<OWLAnnotation> annotations = e.getAnnotations(owlOntology, Constants.JAVADOC); if (annotations.size() == 1) { OWLAnnotation javadocAnnotation = annotations.iterator().next(); if (javadocAnnotation.getValue() instanceof OWLLiteral) { sb.append('\n'); sb.append(((OWLLiteral) javadocAnnotation.getValue()).getLiteral()); } } return sb.toString(); }
public String getCode(OWLOntology ontology, OWLEntity entity) { for (OWLAnnotation annotation : entity.getAnnotations(ontology)) { if (!annotation.getProperty().equals(codeProperty)) { continue; } OWLAnnotationValue value = annotation.getValue(); if (value instanceof OWLLiteral) { return ((OWLLiteral) value).getLiteral(); } } return null; }
private Map<String, Object> getData() { if (__data == null) { __data = new HashMap<>(); for (OWLAnnotation zio : _owl.getAnnotations(_ontology)) { OWLAnnotationValue val = zio.getValue(); String piri = zio.getProperty().getIRI().toString(); String prop = _metadataVocabulary.get(piri); if (prop != null) { __data.put(prop, literal2obj(val)); } } } return __data; }
private Set<String> getAnnotation(OWLEntity entity, String property) { Set<String> annotations = new HashSet<>(); try { OWLAnnotationProperty owlAnnotationProperty = factory.getOWLAnnotationProperty(IRI.create(property)); for (OWLAnnotation annotation : entity.getAnnotations(ontology, owlAnnotationProperty)) { if (annotation.getValue() instanceof OWLLiteral) { OWLLiteral val = (OWLLiteral) annotation.getValue(); annotations.add(val.getLiteral()); } } } catch (Exception e) { throw new RuntimeException("Failed to get label for OWLClass " + entity); } return annotations; }
private Set<String> getAnnotation(OWLEntity entity, String property) { Set<String> annotations = new HashSet<String>(); try { OWLAnnotationProperty owlAnnotationProperty = factory.getOWLAnnotationProperty(IRI.create(property)); for (OWLAnnotation annotation : entity.getAnnotations(ontology, owlAnnotationProperty)) { if (annotation.getValue() instanceof OWLLiteral) { OWLLiteral val = (OWLLiteral) annotation.getValue(); annotations.add(val.getLiteral().toString()); } } } catch (Exception e) { throw new RuntimeException("Failed to get label for OWLClass " + entity); } return annotations; }
public Collection<AnnotationValue> getAnnotationValues(AnnotationProperty property) { return convertA(entity().getAnnotations(onto, convert(property))); }
public Map<AnnotationProperty, Collection<AnnotationValue>> getAnnotations() { Map<AnnotationProperty, Collection<AnnotationValue>> rval = new HashMap<AnnotationProperty, Collection<AnnotationValue>>(); for (OWLAnnotation anno : entity().getAnnotations(onto)) { if (anno.getValue() instanceof OWLLiteral) { AnnotationProperty newAP = new OWLAPIAnnotationProperty(anno.getProperty(), onto); if (!rval.containsKey(newAP)) { rval.put(newAP, new HashSet<AnnotationValue>()); } rval.get(newAP).add(new OWLAPILiteralValue((OWLLiteral) anno.getValue(), onto)); } else if (anno.getValue() instanceof OWLNamedIndividual) { AnnotationProperty newAP = new OWLAPIAnnotationProperty(anno.getProperty(), onto); if (!rval.containsKey(newAP)) { rval.put(newAP, new HashSet<AnnotationValue>()); } rval.get(newAP).add(new OWLAPIIndividual((OWLNamedIndividual) anno.getValue(), onto)); } else if (anno.getValue() instanceof IRI) { AnnotationProperty newAP = new OWLAPIAnnotationProperty(anno.getProperty(), onto); if (!rval.containsKey(newAP)) { rval.put(newAP, new HashSet<AnnotationValue>()); } rval.get(newAP).add(new OWLAPIIndividual(factory.getOWLNamedIndividual((IRI)anno.getValue()), onto)); } } return Collections.unmodifiableMap(rval); }
for (OWLAnnotation annotation : owlEntity.getAnnotations(ontology1)) { OWLAnnotationProperty property = annotation.getProperty(); IRI propertyIRI = property.getIRI();
private void handleEntityBase(OWLEntity entity, OWLOntology ontology, OBOTagValuePairList tvpList) { tvpList.addPair(OBOVocabulary.ID, getID(entity)); Set<OWLAnnotation> potentialNames = new HashSet<OWLAnnotation>(); for (OWLAnnotation annotation : entity.getAnnotations(ontology)) { if (annotation.getProperty().getIRI().equals(OWLRDFVocabulary.RDFS_LABEL.getIRI())) { potentialNames.add(annotation);
@Override public void generateSearchMetadataFor(OWLEntity entity, String entityRendering, final SearchMetadataImportContext context, SearchMetadataDB db) { for (OWLOntology ontology : context.getOntologies()) { for (final OWLAnnotation annotation : entity.getAnnotations(ontology)) { String groupDescription = context.getRendering(annotation.getProperty()); StyledString ren = context.getStyledStringRendering(annotation); SearchMetadata md = new SearchMetadata(SearchCategory.ANNOTATION_VALUE, groupDescription, entity, entityRendering, ren.getString()) { @Override public StyledString getStyledSearchSearchString() { return context.getStyledStringRendering(annotation); } }; db.addResult(md); } } } }
private void handleEntityBase(OWLEntity entity, OWLOntology ontology, OBOTagValuePairList tvpList) { tvpList.addPair(OBOVocabulary.ID, getID(entity)); Set<OWLAnnotation> potentialNames = new HashSet<OWLAnnotation>(); for (OWLAnnotation annotation : entity.getAnnotations(ontology)) { if (annotation.getProperty().getIRI().equals(OWLRDFVocabulary.RDFS_LABEL.getIRI())) { potentialNames.add(annotation);
public Collection<LiteralOrIndividual> getPropertyValues(Property property) { if(property instanceof DatatypeProperty) { return convertLOI(indiv.getDataPropertyValues(convert((DatatypeProperty)property),onto)); } else if(property instanceof ObjectProperty) { return convertLOI(indiv.getObjectPropertyValues(convert((ObjectProperty)property),onto)); } else { return convertA2LOI(entity().getAnnotations(onto,convert((AnnotationProperty)property))); } } public boolean addProperty(Property property, LiteralOrIndividual value) {
private void handleEntityBase(OWLEntity entity, OWLOntology ontology, OBOTagValuePairList tvpList) { tvpList.addPair(OBOVocabulary.ID, getID(entity)); Set<OWLAnnotation> potentialNames = new HashSet<OWLAnnotation>(); for (OWLAnnotation annotation : entity.getAnnotations(ontology)) { if (annotation.getProperty().getIRI().equals(OWLRDFVocabulary.RDFS_LABEL.getIRI())) { potentialNames.add(annotation);
Set<OWLAnnotation> annotations = owlEntity.getAnnotations(owlModelManager.getActiveOntology()); if(annotations.size() > 0) { currentPos = addCollectionTextValues(annotations, "Annotations:", font, currentPos);
Set<OWLAnnotation> annotations = owlEntity.getAnnotations(owlModelManager.getActiveOntology()); if(annotations.size() > 0) { currentPos = addCollectionTextValues(annotations, "Annotations:", font, currentPos);
public boolean isDeprecated(OWLEntity e, DifferencePosition position) { OWLOntology ontology = position.getOntology(engine.getOwlDiffMap()); for (OWLOntology ont : ontology.getImportsClosure()) { for (OWLAnnotation annotation : e.getAnnotations(ont, engine.getOWLDataFactory().getOWLDeprecated())) { if (!(annotation.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) annotation.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; }