query-78b2d3bd305c75b9bd6b2dc47729db34

rq turtle/ttl

: Maybe this will help:Alina data@ ! Example : Template:Id urlAnd it’s done on {{Sparql|query=select ?edition ?editionurl where { {{Id url|?edition|P1025|?editionurl}} } }} gives Usage Every editions from sudoc known to wikidata with their uris|?edition|SUDOC editions|?editionurl}}Id url{{ or |?edition|P1025|?editionurl}}Id url{{ ?edition wdt:P1025 ?ideditionP1025 . ?directeditionP1025 wikibase:directClaim wdt:P1025 . ?directeditionP1025 wikibase:propertyType wikibase:ExternalId . ?directeditionP1025 wdt:P1630 ?baseurleditionP1025 . BIND(IRI(REPLACE(?ideditionP1025, '^(.+)$', ?baseurleditionP1025 )) AS ?editionurl). Used in a full query (wikitext): {{Sparql|query=select ?edition ?editionurl where { {{Id url|?edition|P1025|?editionurl}} } }} gives

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
select ?edition ?editionurl where {
  ?edition wdt:P1025 ?ideditionP1025 .
  ?directeditionP1025 wikibase:directClaim wdt:P1025 .
  ?directeditionP1025 wikibase:propertyType wikibase:ExternalId . 
  ?directeditionP1025 wdt:P1630 ?baseurleditionP1025 .
  BIND(IRI(REPLACE(?ideditionP1025, '^(.+)$', ?baseurleditionP1025 )) AS ?editionurl).
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?baseurleditionP1025") v3("?directeditionP1025") v1("?edition"):::projected v5("?editionurl"):::projected v2("?ideditionP1025") c1(["wdt:P1025"]):::iri c4(["wikibase:ExternalId"]):::iri v1 -->c1--> v2 v3 --"wikibase:directClaim"--> c1 v3 --"wikibase:propertyType"--> c4 v3 --"wdt:P1630"--> v4 bind0[/"replace(?ideditionP1025,'^(.+)$',?baseurleditionP1025)"/] v2 --o bind0 v4 --o bind0 bind0 --as--o v5