Advanced Example
Below is an example of a more advanced search.
Multi-domain specification search with specific DS filters and conditions
This query asks for things that comply with at least one of three different domain specifications with a fixed location. The location has different domain specifications and different models to store the address locality. In addition, things with a start date should be only after a certain date
"sq:query": [
{
"ds:compliesWith": {
"sq:value": "https://semantify.it/ds/mhpmBCJJt",
"sq:datatype": "iri"
},
"schema:location": {
"schema:address": {
"schema:addressLocality": "Jena"
}
},
"schema:startDate": {
"sq:value": "2022-04-27T00:00:00",
"sq:op": ">="
}
},
{
"ds:compliesWith": {
"sq:value": "https://semantify.it/ds/sloejGAwT",
"sq:datatype": "iri"
},
"schema:address": {
"schema:addressLocality": "Jena"
}
},
{
"ds:compliesWith": {
"sq:value": "https://semantify.it/ds/nBTyKDsKX",
"sq:datatype": "iri"
},
"schema:address": {
"schema:addressLocality": "Jena"
}
}
]
Explanation
The query is an array with three objects. Every object represents a condition. The conditions are disjunctive, which means: "Show me all elements where either condition one, condition two, or condition three holds."
Condition 1, lines 2 to 16
This condition is denoted as an object with three properties. Each property specifies a conjunctive condition.
The first condition says that there must be a property ds:compliesWith
with a value of type iri
that is exactly https://semantify.it/ds/mhpmBCJJt
.
The second condition says that there must be a property schema.location
that has an object as a range where this object itself has a property address
. This property also has an object as range, which has a property schema:addressLocality
with a string value that equalsJena
.
The third condition requires a property schema:startDate
that has a value which will be compared to the value 2022-04-27T00:00:00
with an operator >=
. This means there needs to be a start date greater or equal to the 27th of April 2024.
Condition 2, lines 17 to 25 and condition 3, lines 26 to 34...
...are already explained by condition 1 with the difference that the location name "Jena" is stored differently than in the other conditions.
Updated 2 months ago