@Override public Map<OWLIndividual, SortedSet<Double>> getDoubleDatatypeMembersImpl(OWLDataProperty datatypeProperty) { Map<OWLIndividual, SortedSet<Double>> subject2objects = new HashMap<>(); String query = "SELECT ?s ?o WHERE {" + String.format("?s <%s> ?o.", datatypeProperty.toStringID()) + " FILTER(" + datatypeSparqlFilter(OWLAPIUtils.floatDatatypes) + ")}"; ResultSet rs = executeSelectQuery(query); while(rs.hasNext()){ QuerySolution qs = rs.next(); OWLIndividual sub = df.getOWLNamedIndividual(IRI.create(qs.getResource("s").getURI())); Literal val = qs.getLiteral("o").asLiteral(); // Virtuoso bug workaround which returns NAN instead of NaN Double obj = "NAN".equals(val.getLexicalForm()) ? Double.NaN : val.getDouble(); subject2objects.computeIfAbsent(sub, k -> new TreeSet<>()).add(obj); } return subject2objects; }
return Factory.getInstance(securityEvaluator, modelName.asLiteral().getString(), baseModel);
@Nonnull @Override public String getShortForm(@Nonnull OWLEntity entity) { queryTemplate.clearParams(); queryTemplate.setIri("entity", entity.toStringID()); queryTemplate.setIri("labelProperty", labelProperty); Query query = queryTemplate.asQuery(); try(QueryExecution qe = qef.createQueryExecution(query)) { ResultSet rs = qe.execSelect(); String label = null; if(rs.hasNext()){ label = rs.next().getLiteral("label").asLiteral().getLexicalForm(); } else { label = fallback.getShortForm(entity.getIRI()); } return label; } } }
this.saveToVar = saveTo.asLiteral().getLexicalForm(); }else{ this.saveToVar = defaultVarNameForResults;
this.saveToVar = saveTo.asLiteral().getLexicalForm(); }else{ this.saveToVar = defaultVarNameForResults;
this.saveToVar = saveTo.asLiteral().getLexicalForm(); }else{ this.saveToVar = defaultVarNameForResults;
if (set.hasNext()) { set.forEachRemaining(sol -> { ProfilingProperty pp = new ProfilingProperty(sol.getLiteral("propertyLabel").asLiteral().getString(), sol.getLiteral("propertyComment").asLiteral().getString(), sol.getLiteral("propertyValue").asLiteral().getValue()); profile.addProfilingProperty(pp); }); if (set.hasNext()) { set.forEachRemaining(sol -> { ProvenanceProperty pp = new ProvenanceProperty(sol.getLiteral("provPropertyLabel").asLiteral().getString(), sol.getLiteral("provPropertyComment").asLiteral().getString(), sol.getLiteral("provPropertyValue").asLiteral().getValue()); profile.addProvenanceProperties(pp); });