query-f2f13e54fdebb5c34855f8cc8ee18069

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?pl ?signatory ?date2 ?short ?itemLabel (CONCAT("Public Law ",?pl, ". ", STRBEFORE(?stat,"-"), " Stat ", STRAFTER(?stat,"-"),".") as ?text) 
WHERE {
  ?item wdt:P3825 ?stat ;
        wdt:P3837 ?pl .
  OPTIONAL { ?item wdt:P585 ?date . }
  OPTIONAL { ?item wdt:P1813 ?short . }
  OPTIONAL { ?item p:P1891 ?stat2 .
            ?stat2 ps:P1891 ?signatory; .
            OPTIONAL {?stat2 pq:P585 ?date2 .}
           }
  OPTIONAL { 
}
  FILTER (CONTAINS(?pl, '116-')) .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en"  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?date") v8("?date2"):::projected v2("?item"):::projected v1("?pl"):::projected v5("?short"):::projected v7("?signatory"):::projected v3("?stat"):::projected v6("?stat2") v9("?text") c10(["bd:serviceParam"]):::iri c12(["en,en"]):::literal f0[["contains(?pl,'116-')"]] f0 --> v1 v2 --"p:direct/P3825"--> v3 v2 --"p:direct/P3837"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P585".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P1813".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P1891".-> v6 v6 --"p:statement/P1891"--> v7 subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:qualifier/P585".-> v8 end end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 -."wikibase:language".-> c12 end bind1[/"concat('Public Law ',?pl,'. ',substring-before(?stat,'-'),' Stat ',substring-after(?stat,'-'),'.')"/] v1 --o bind1 v3 --o bind1 bind1 --as--o v9