query-ebdee2d0a0e4402b5a7a092d42ce20e8
url lookup
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Table
SELECT DISTINCT ?iri ?prop ?propLabel ?id ?item ?itemLabel WHERE {
VALUES ( ?test_url ) {
( "https://quickstats.censusdata.abs.gov.au/census_services/getproduct/census/2016/quickstat/SSC11428" )
( "http://plantnet.rbgsyd.nsw.gov.au/cgi-bin/NSWfl.pl?page=nswfl&lvl=sp&name=Hibbertia~spanantha" )
( "https://www.lions.com.au/players/7" )
( "https://reiseauskunft.bahn.de/bin/bhftafel.exe/en?input=8400285&boardType=dep&time=actual&productsDefault=1111101&start=yes" )
}
BIND( IRI(?test_url) AS ?iri ).
{?prop wdt:P1630 ?formatter_url .}
UNION
{?prop wdt:P3303 ?formatter_url .}
FILTER (CONTAINS( ?formatter_url, "$1" ) )
BIND (STRBEFORE( ?formatter_url, "$1" ) AS ?f_url_start )
BIND (STRAFTER( ?formatter_url, "$1" ) AS ?f_url_end )
FILTER(STRSTARTS( ?test_url, ?f_url_start ))
FILTER(STRENDS( ?test_url, ?f_url_end ))
BIND ( SUBSTR( ?test_url, 1+STRLEN(?f_url_start), STRLEN(?test_url)-STRLEN(?f_url_start)-STRLEN(?f_url_end) ) AS ?id )
?prop wikibase:directClaim ?propRel .
?item ?propRel ?id .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?f_url_end")
v7("?f_url_start")
v4("?formatter_url")
v7("?id"):::projected
v5("?iri"):::projected
v9("?item"):::projected
v6("?prop"):::projected
v8("?propRel")
v5("?test_url")
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
f0[["ends-with(?test_url,?f_url_end)"]]
f0 --> v5
f0 --> v7
f1[["starts-with(?test_url,?f_url_start)"]]
f1 --> v5
f1 --> v7
f2[["contains(?formatter_url,'$1')"]]
f2 --> v4
bind3[/VALUES ?test_url/]
bind3-->v5
bind30(["https://quickstats.censusdata.abs.gov.au/census_services/getproduct/census/2016/quickstat/SSC11428"])
bind30 --> bind3
bind31(["http://plantnet.rbgsyd.nsw.gov.au/cgi-bin/NSWfl.pl?page=nswfl&lvl=sp&name=Hibbertia~spanantha"])
bind31 --> bind3
bind32(["https://www.lions.com.au/players/7"])
bind32 --> bind3
bind33(["https://reiseauskunft.bahn.de/bin/bhftafel.exe/en?input=8400285&boardType=dep&time=actual&productsDefault=1111101&start=yes"])
bind33 --> bind3
bind4[/"?test_url"/]
v5 --o bind4
bind4 --as--o v5
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v6 --"wdt:P3303"--> v4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v6 --"wdt:P1630"--> v4
end
union0r <== or ==> union0l
end
bind5[/"substring-before(?formatter_url,'$1')"/]
v4 --o bind5
bind5 --as--o v7
bind6[/"substring-after(?formatter_url,'$1')"/]
v4 --o bind6
bind6 --as--o v7
bind7[/"substring(?test_url,'1^^xsd:integer' + string-length(?f_url_start),string-length(?test_url) - string-length(?f_url_start) - string-length(?f_url_end))"/]
v5 --o bind7
v7 --o bind7
v7 --o bind7
bind7 --as--o v7
v6 --"wikibase:directClaim"--> v8
v9 -->v8--> v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end