@Override public Collection<OWLLiteral> getPropertyValues(OWLNamedIndividual i, OWLDataProperty p) { Set<OWLLiteral> results = new HashSet<OWLLiteral>(); for (OWLOntology imported : ontology.getImportsClosure()) { results.addAll(i.getDataPropertyValues(p, imported)); } return results; }
@Override public Collection<OWLLiteral> getPropertyValues(OWLNamedIndividual i, OWLDataProperty p) { Set<OWLLiteral> results = new HashSet<OWLLiteral>(); results.addAll(reasoner.getDataPropertyValues(i, p)); // the behavior of getDataPropertyValues is somewhat undefined // so make sure that the asserted ones are included. for (OWLOntology imported : ontology.getImportsClosure()) { results.addAll(i.getDataPropertyValues(p, imported)); } return results; }
public Map<Property,Collection<LiteralOrIndividual>> getProperties() { HashMap<Property,Collection<LiteralOrIndividual>> rval = new HashMap<Property,Collection<LiteralOrIndividual>>(); rval.putAll(convertDP2M(indiv.getDataPropertyValues(onto))); rval.putAll(convertOP2M(indiv.getObjectPropertyValues(onto))); return Collections.unmodifiableMap(rval); } public Collection<LiteralOrIndividual> getPropertyValues(Property property) {
private void printDataPropertyValues(StringBuffer sb, ShortFormProvider provider) { Map<OWLDataPropertyExpression, Set<OWLLiteral>> valueMap = new TreeMap<OWLDataPropertyExpression, Set<OWLLiteral>>(owlIndividual.getDataPropertyValues(owlOntology)); for (Entry<OWLDataPropertyExpression, Set<OWLLiteral>> entry : valueMap.entrySet()) { OWLDataProperty property = entry.getKey().asOWLDataProperty(); Set<OWLLiteral> values = entry.getValue(); sb.append(provider.getShortForm(property)); sb.append(": "); boolean firstTime = true; for (OWLLiteral value : values) { if (firstTime) { firstTime = false; } else { sb.append(", "); } sb.append(value.getLiteral()); } sb.append("; "); } }
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) {
Map<OWLDataPropertyExpression, Set<OWLLiteral>> dataPropAssertions = individual.getDataPropertyValues(ontology); for (OWLDataPropertyExpression p : dataPropAssertions.keySet()) { if (!p.isAnonymous()) {
Map<OWLDataPropertyExpression, Set<OWLLiteral>> dataPropAssertions = individual.getDataPropertyValues(ontology); for (OWLDataPropertyExpression p : dataPropAssertions.keySet()) { if (!p.isAnonymous()) {
Map<OWLDataPropertyExpression, Set<OWLLiteral>> dataPropAssertions = individual.getDataPropertyValues(ontology); for (OWLDataPropertyExpression p : dataPropAssertions.keySet()) { if (!p.isAnonymous()) {