Template:Id url
?work ?workidentifierproperty ?idworkidentifierproperty . ?directworkidentifierproperty wikibase:directClaim ?workidentifierproperty . ?directworkidentifierproperty wikibase:propertyType wikibase:ExternalId . ?directworkidentifierproperty wdt:P1630 ?baseurlworkidentifierproperty .
BIND(IRI(REPLACE(?idworkidentifierproperty, '^(.+)$', ?baseurlworkidentifierproperty )) AS ?urlworkidentifierproperty).
Partial query to help getting uris from identifier properties and their formatting uris.
Usage
edit{{Id url|?edition|P1025|?editionurl}}
or{{Id url|?edition|SUDOC editions|?editionurl}}
Every editions from sudoc known to wikidata with their uris
?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
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).
}
Also using the property english label :
?edition wdt:P1025 ?ideditionSUDOC_editions . ?directeditionSUDOC_editions wikibase:directClaim wdt:P1025 . ?directeditionSUDOC_editions wikibase:propertyType wikibase:ExternalId . ?directeditionSUDOC_editions wdt:P1630 ?baseurleditionSUDOC_editions . BIND(IRI(REPLACE(?ideditionSUDOC_editions, '^(.+)$', ?baseurleditionSUDOC_editions )) AS ?editionurl).
{{Id url|Q19184969|P1025|?editionurl|?id}}
The sudoc id and url for Pour la vie (Q19184969)
wd:Q19184969 wdt:P1025 ?id . ?directQ19184969P1025 wikibase:directClaim wdt:P1025 . ?directQ19184969P1025 wikibase:propertyType wikibase:ExternalId . ?directQ19184969P1025 wdt:P1630 ?baseurlQ19184969P1025 . BIND(IRI(REPLACE(?id, '^(.+)$', ?baseurlQ19184969P1025 )) AS ?editionurl).
select ?id ?editionurl where {
wd:Q19184969 wdt:P1025 ?id .
?directQ19184969P1025 wikibase:directClaim wdt:P1025 .
?directQ19184969P1025 wikibase:propertyType wikibase:ExternalId .
?directQ19184969P1025 wdt:P1630 ?baseurlQ19184969P1025 .
BIND(IRI(REPLACE(?id, '^(.+)$', ?baseurlQ19184969P1025 )) AS ?editionurl).
}
{{Id url|Q5|?prop|?humanurl}}
Every identifier urls known in Wikidata for Pour la vie (Q19184969)
wd:Q5 ?prop ?idQ5prop . ?directQ5prop wikibase:directClaim ?prop . ?directQ5prop wikibase:propertyType wikibase:ExternalId . ?directQ5prop wdt:P1630 ?baseurlQ5prop . BIND(IRI(REPLACE(?idQ5prop, '^(.+)$', ?baseurlQ5prop )) AS ?humanurl).
select ?humanurl where {
wd:Q5 ?prop ?idQ5prop .
?directQ5prop wikibase:directClaim ?prop .
?directQ5prop wikibase:propertyType wikibase:ExternalId .
?directQ5prop wdt:P1630 ?baseurlQ5prop .
BIND(IRI(REPLACE(?idQ5prop, '^(.+)$', ?baseurlQ5prop )) AS ?humanurl).
}
See also
editNo description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
item | 1 variable | variable or wikidata value for the item(s) we are interested into getting uris
| String | suggested |
identifierproperty | 2 i | a variable or a property id or a property english label for which we want uris
| String | suggested |
url | 3 externalurl | variable for the url of the external sites for our items (may work for sparql strings uris we want to find the item)
| String | optional |
identifier | 4 id | variable name to get ids (may also work with a sparql string value for the id)
| Unknown | optional |
The above documentation is transcluded from Template:Id url/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |