Ich schreibe folgende SPARQL-Abfrage.FILTER mit MIN in SPARQL
select ?o1, ?o2, ?e from <http://ndssl.bi.vt.edu/chicago/>
where{
?s <http://ndssl.bi.vt.edu/chicago/vocab/dendrogram_infector_pid> ?o1.
?s <http://ndssl.bi.vt.edu/chicago/vocab/dendrogram_infectee_pid> ?o2.
?s <http://ndssl.bi.vt.edu/chicago/vocab/dendrogram_iteration> '0'^^xsd:decimal.
?s <http://ndssl.bi.vt.edu/chicago/vocab/dendrogram_exposureday> ?e.
?s1 <http://ndssl.bi.vt.edu/chicago/vocab/contactnetwork_pid1> ?o1.
?s1 <http://ndssl.bi.vt.edu/chicago/vocab/contactnetwork_pid2> ?o2.
?s1 <http://ndssl.bi.vt.edu/chicago/vocab/contactnetwork_acttype1> '5'^^xsd:decimal.
?s1 <http://ndssl.bi.vt.edu/chicago/vocab/contactnetwork_acttype1> '5'^^xsd:decimal
}
Abfrage gibt das Ergebnis wie folgt zurück.
<http://ndssl.bi.vt.edu/chicago/person/pid#449563560> <http://ndssl.bi.vt.edu/chicago/person/pid#446718746> 32
<http://ndssl.bi.vt.edu/chicago/person/pid#449563560> <http://ndssl.bi.vt.edu/chicago/person/pid#446734805> 5
<http://ndssl.bi.vt.edu/chicago/person/pid#450309500> <http://ndssl.bi.vt.edu/chicago/person/pid#450261482> 30
Ich möchte nur das Triple, wo "? E" ist minimal. Das bedeutet Folgendes:
<http://ndssl.bi.vt.edu/chicago/person/pid#449563560> <http://ndssl.bi.vt.edu/chicago/person/pid#446734805> 5
Wie kann ich es tun? Ich habe versucht zu folgen, aber es funktioniert nicht.
.............
?s <http://ndssl.bi.vt.edu/chicago/vocab/dendrogram_exposureday> ?e.FILTER (MIN (?e))
.............
Ich brauche den minimalen Wert des Objekts „? E“ in „WHERE“ -Klausel, weil einige andere Teil der Abfrage hängt von ihm zu finden.
'ORDER BY ASC (? E) LIMIT 1' – AKSW
Warum ist dies markiert jena? – AndyS