query-68cf17d3805159ee09f4ed7fccc937e2
title:Query con filtro (FILTER) basato sul REGEX applicato a un URL SELECT ?item ?itemLabel ?datanascita ?url WHERE { ?item wdt:P106 wd:Q13418253. ?item p:P569 ?d . ?d a wikibase:BestRank . #per ottenere il BestRank si usa "a" come predicato anziché "wikibase:rank" ?d ps:P569 ?datanascita . ?d prov:wasDerivedFrom ?riferimento . ?riferimento pr:P854 ?url . FILTER(REGEX(STR(?url), "treccani")) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Query con filtro (FILTER) basato sul REGEX applicato a un URL
SELECT ?item ?itemLabel ?datanascita ?url
WHERE {
?item wdt:P106 wd:Q13418253.
?item p:P569 ?d .
?d a wikibase:BestRank . #per ottenere il BestRank si usa "a" come predicato anziché "wikibase:rank"
?d ps:P569 ?datanascita .
?d prov:wasDerivedFrom ?riferimento .
?riferimento pr:P854 ?url .
FILTER(REGEX(STR(?url), "treccani"))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?d")
v4("?datanascita"):::projected
v2("?item"):::projected
v5("?riferimento")
v1("?url"):::projected
c6(["wikibase:BestRank"]):::iri
c11(["bd:serviceParam"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q13418253"]):::iri
f0[["regex(str(?url),'treccani')"]]
f0 --> v1
v2 --"p:direct/P106"--> c3
v2 --"p:P569"--> v3
v3 --"a"--> c6
v3 --"p:statement/P569"--> v4
v3 --"prov:wasDerivedFrom"--> v5
v5 --"p:reference/P854"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end