Open main menu

MB-one

Joined 31 October 2012

Current activityEdit

Tools & queriesEdit

SnippetsEdit

  • p:P31/ps:P31/wdt:P279* (checks subclasses)
  • BIND(SUBSTR(STR(?item), (STRLEN(STR(<http://www.wikidata.org/entity/>))) + 1) AS ?qid) (extracts QID from URL)
  • BIND(SUBSTR( ?string, 1, 4 ) as ?substring) (extracts substrings; here: 1 = starting at first character; 4 = four characters long)
  • (COUNT(?item) AS ?count) (counts items)
  • (CONCAT('"', ?item, '"') AS ?value) (concatenates values and strings)
  • ?article schema:about ?item .
?article schema:isPartOf <https://en.wikipedia.org/>. (checks for existing articles in other wikis)
  • OPTIONAL {?item rdfs:label ?label_en , ?label_de , ?label_fr}
filter(lang(?label_en) = 'en' && lang(?label_de) = 'de' && lang(?label_fr) = 'fr') (gives multiple language labels)
  • OPTIONAL {?item schema:description ?desc FILTER (LANG (?desc) = "de") .} (gives description in selected language)
  • BIND( IF( ?value1 = ?value2, "same", "different" ) AS ?result ) (compares values)
  • { ?item wdt:P131 ?admin1. }
UNION
{ ?item wdt:P131 ?admin2. } (Union of two separate statements)
  • ?item p:P131 ?statement.
?statement ps:P131 wd:Q472 .
FILTER NOT EXISTS {
?statement prov:wasDerivedFrom ?ref
}(statement without references)
  • ?item p:P1082 ?statement.
?statement ps:P1082 ?population.
?statement pq:P585 ?qualifier. (statement with qualifier)

Full QueriesEdit

ToolsEdit