Wikidata:Synia:topic
Jump to navigation
Jump to search
Synia: topic
[edit]PREFIX target: <http://www.wikidata.org/entity/Q54871>
SELECT DISTINCT
?description
?value ?valueUrl
?wikidata ?wikidataUrl
?scholia ?scholiaUrl
# ?wikidata_topic_curator1 ?wikidata_topic_curator1Url
# ?wikidata_topic_curator2 ?wikidata_topic_curator2Url
WHERE {
{
BIND(1 AS ?order)
BIND("Topic" AS ?description)
BIND(target: AS ?iri)
BIND(SUBSTR(STR(?iri), 32) AS ?q)
?iri rdfs:label ?value_string .
FILTER (LANG(?value_string) = 'en')
BIND(COALESCE(?value_string, ?q) AS ?value)
BIND(CONCAT(?q, " ↗") AS ?wikidata)
BIND(CONCAT("https://www.wikidata.org/wiki/", ?q) AS ?wikidataUrl)
BIND("Scholia ↗" AS ?scholia)
BIND(CONCAT("https://scholia.toolforge.org/topic/", ?q) AS ?scholiaUrl)
# BIND("Wikidata Topic Curator (Scientific documents) ↗" AS ?wikidata_topic_curator1)
# BIND(CONCAT("http://162.19.226.24:8080/term?lang=en&subgraph=&qid=", ?q) AS ?wikidata_topic_curator1Url)
# BIND("Wikidata Topic Curator (Riksdagen documents) ↗" AS ?wikidata_topic_curator2)
# BIND(CONCAT("http://162.19.226.24:8080/term?lang=sv&subgraph=riksdagen_documents&qid=", ?q) AS ?wikidata_topic_curator2Url)
}
UNION
{
BIND(2 AS ?order)
BIND("Class" AS ?description)
target: wdt:P31 ?iri .
BIND(SUBSTR(STR(?iri), 32) AS ?q)
?iri rdfs:label ?value_string .
FILTER (LANG(?value_string) = 'en')
BIND(COALESCE(?value_string, ?q) AS ?value)
BIND(CONCAT("#topic/", ?q) AS ?valueUrl)
}
UNION
{
BIND(3 AS ?order)
BIND("Superclass" AS ?description)
target: wdt:P279 ?iri .
BIND(SUBSTR(STR(?iri), 32) AS ?q)
?iri rdfs:label ?value_string .
FILTER (LANG(?value_string) = 'en')
BIND(COALESCE(?value_string, ?q) AS ?value)
BIND(CONCAT("#topic/", ?q) AS ?valueUrl)
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?order
Direct subtopics
[edit]PREFIX target: <http://www.wikidata.org/entity/Q124490>
SELECT ?item ?itemLabel
(CONCAT("#topic/", SUBSTR(STR(?item), 32)) AS ?itemUrl)
WHERE
{
?item wdt:P279 target: .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,cs,da,de,sv". }
}
Works about the topic
[edit]PREFIX target: <http://www.wikidata.org/entity/Q54871>
SELECT DISTINCT
(xsd:date(?publication_datetime) AS ?publication_date)
?work ?workLabel
(CONCAT("#work/", SUBSTR(STR(?work), 32)) AS ?workUrl)
?workDescription
WHERE {
?work wdt:P921 / (wdt:P31| wdt:P279 | wdt:P361 | wdt:P1269)? # Expensive: *
target: ;
wdt:P577 ?publication_datetime .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,cs,da,de,se,sv". }
}
ORDER BY DESC(?publication_datetime)
LIMIT 500
Venues publishing about the topic
[edit]PREFIX target: <http://www.wikidata.org/entity/Q54871>
SELECT
?count
(CONCAT("#venue/", SUBSTR(STR(?venue), 32),
"/topic/", SUBSTR(STR(target:), 32)) AS ?countUrl)
?venue ?venueLabel
(CONCAT("#venue/", SUBSTR(STR(?venue), 32)) AS ?venueUrl)
?venueDescription
WITH {
SELECT
(COUNT(DISTINCT ?work) AS ?count)
?venue
WHERE {
?work wdt:P921 / (wdt:P31| wdt:P279 | wdt:P361 | wdt:P1269)? # Expensive query: *
target: ;
wdt:P1433 ?venue .
}
GROUP BY ?venue
} AS %result
WHERE {
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?count)
LIMIT 200
Languages
[edit]PREFIX target: <http://www.wikidata.org/entity/Q2005>
SELECT DISTINCT
?works
(CONCAT("#topic/", SUBSTR(STR(target:), 32), "/language/", SUBSTR(STR(?language), 32)) AS ?worksUrl)
?language ?languageLabel
(CONCAT("#language/", SUBSTR(STR(?language), 32)) AS ?languageUrl)
?languageDescription
?example_work ?example_workLabel
(CONCAT("#work/", SUBSTR(STR(?example_work), 32)) AS ?example_workUrl)
WITH {
SELECT
(COUNT(?work) AS ?works)
?language
(SAMPLE(?work) AS ?example_work)
WHERE {
?work wdt:P921 / (wdt:P31| wdt:P279 | wdt:P361 | wdt:P1269)? # Expensive: *
target: ;
wdt:P407 ?language .
}
GROUP BY ?language
} AS %languages
WHERE {
INCLUDE %languages
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?works)