NOSAD-POC: Difference between revisions

Jump to navigation Jump to search
1,091 bytes removed ,  2 years ago
Line 59: Line 59:
ORDER BY DESC(?dt) ?sessLabel (!BOUND(?start)) ?start ?presLabel
ORDER BY DESC(?dt) ?sessLabel (!BOUND(?start)) ?start ?presLabel
</sparql>
</sparql>
==== Hämta alla organisation i Oswald som har koppling WD och hämta från WD med SPARQL federation deras Organisationsnummer, visa det på Quickstatement format ====
{{NOSAD-POC_Federation_Quick}}
* se [https://github.com/salgo60/NOSAD-POC-Wikidata/issues/23 #23]
<sparql tryit="1">
#title:  org hos NOSAD där WD har Organisationsnr P6460 info som saknas lokalt P37 som QuickStatement - SPARQL Federation
PREFIX od: <https://oswald.wikibase.cloud/entity/>
PREFIX odt: <https://oswald.wikibase.cloud/prop/direct/>
 
SELECT DISTINCT ?Oswald ("P37" AS ?P) ?orgnr WHERE {
 
  VALUES ?Orgobj {
    od:Q76
  }
  ?org odt:P12 ?Orgobj.
  ?org odt:P2 ?WDs.
  BIND(URI(REPLACE(STR(?WDs), "https://www.wikidata.org/wiki/", "http://www.wikidata.org/entity/")) AS ?WD)
  SERVICE <https://query.wikidata.org/sparql> {
    ?WD wdt:P6460 ?wdorg.
    BIND(CONCAT("\"", str(?wdorg), "\"") AS ?orgnr)
  }
  BIND(REPLACE(STR(?org), "https://oswald.wikibase.cloud/entity/", "") AS ?Oswald)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
}
ORDER BY (?spkrOswaldLabel)
</sparql>
* [https://www.wikidata.org/wiki/Help:QuickStatements Quickstatements]

Navigation menu