Example of list of patients with their main diagnosis. This means we want:
FILTER
clause.Query in Sparkle's form-based environment is shown on the next figure.
Results you will see when you push Evaluate button.
You can switch to Query tab showing generated SPARQL query in text editor with simple highlighting and auto-complete functions Ctrl + Space
when query evaluated.
The generated SELECT
query in the SPARQL is:
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX ds: <http://mre.zcu.cz/ontology/dasta.owl#> SELECT ?id ?sex ?diagDate ?code FROM <https://mre.zcu.cz/metadata/medical> WHERE { ?diagnosis a ds:ActualDiagnosis ; ds:diagOrder ?diagnosisOrder ; ds:datetimeEvent ?diagDate ; ds:diagCode ?code . ?diagnosis ds:patient/ds:patientID ?id . ?diagnosis ds:patient/ds:sex ?sex FILTER ( xsd:int(?diagnosisOrder) = "1"^^xsd:int ) } ORDER BY ASC(xsd:int(?id))
You can download example 1 in Sparkle's SQF.
Query in Sparkle's form-based environment is shown on the next figure.
Results you will see when you push Evaluate button.
You can switch to Query tab showing generated SPARQL query.
The generated SELECT
query in the SPARQL is:
SELECT ?property (COUNT(?subject) AS ?count) WHERE { ?subject ?property ?object } GROUP BY ?property HAVING ( ?count > 50 ) ORDER BY DESC(?count)
You can download example 2 in Sparkle's SQF.