wikidata

How to get all properties for only a specific category in Wikidata?

ⅰ亾dé卋堺 提交于 2019-12-01 11:24:46
Is there an rdf data/other format that allow me to get all the properties that can exist in a category e.g. Person, then I should be returned properties like sex, date of birth How to query this information at https://query.wikidata.org/ ? What i want is this https://www.wikidata.org/wiki/Wikidata:List_of_properties/Summary_table But is there a better format for this ? I want to access programmatically UPDATE This query is too heavy, causes timeout. SELECT ?p ?attName WHERE { ?q wdt:P31 wd:Q5. ?q ?p ?statement. ?realAtt wikibase:claim ?p. ?realAtt rdfs:label ?attName. FILTER(((LANG(?attName))

Wikidata+SPARQL: lookup a company based on it's ticker symbol

倖福魔咒の 提交于 2019-12-01 09:47:39
I'm trying to lookup a company based on it's ticker symbol using sparql. This query will list businesses and their tickers (basic query) SELECT DISTINCT ?id ?idLabel ?ticker WHERE { ?id wdt:P31/wdt:P279* wd:Q4830453 . ?id wdt:P249 ?ticker . ?id rdfs:label ?idLabel FILTER(LANG(?idLabel) = 'en'). } But, IBM is not included, because IBM has it's stock ticker placed 'inside' the P414 property (Stock exchange). https://www.wikidata.org/wiki/Q37156 How can I expand this list to include companies with P414 and P249 tickers "inside" them? Here is how I can show ibm is not included: SELECT DISTINCT ?id

How to get all properties for only a specific category in Wikidata?

你说的曾经没有我的故事 提交于 2019-12-01 08:24:04
问题 Is there an rdf data/other format that allow me to get all the properties that can exist in a category e.g. Person, then I should be returned properties like sex, date of birth How to query this information at https://query.wikidata.org/ ? What i want is this https://www.wikidata.org/wiki/Wikidata:List_of_properties/Summary_table But is there a better format for this ? I want to access programmatically UPDATE This query is too heavy, causes timeout. SELECT ?p ?attName WHERE { ?q wdt:P31 wd:Q5

Wikidata+SPARQL: lookup a company based on it's ticker symbol

让人想犯罪 __ 提交于 2019-12-01 07:28:15
问题 I'm trying to lookup a company based on it's ticker symbol using sparql. This query will list businesses and their tickers (basic query) SELECT DISTINCT ?id ?idLabel ?ticker WHERE { ?id wdt:P31/wdt:P279* wd:Q4830453 . ?id wdt:P249 ?ticker . ?id rdfs:label ?idLabel FILTER(LANG(?idLabel) = 'en'). } But, IBM is not included, because IBM has it's stock ticker placed 'inside' the P414 property (Stock exchange). https://www.wikidata.org/wiki/Q37156 How can I expand this list to include companies

Get all Wikidata items that are an instance of a given item

眉间皱痕 提交于 2019-11-30 20:21:42
Wikidata has an item called smartphone model . I want to get all instances of it. QUESTION: How to get the identifiers of the instances programmatically, using the live server? Preferably not including false positives that show up in WhatLinksHere but are in the "Wikidata:" namespace rather than the main namespace. Your question specifies the "Mediawiki API" but this is not possible. Wikidata has a SPARQL query service at https://query.wikidata.org The query that you want is: PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> SELECT DISTINCT ?item

SPARQL Speed up federated query

梦想与她 提交于 2019-11-30 18:04:42
问题 I have my own dataset and I want to perform a federated query in SPARQL. Here is the query: PREFIX : <http://myURIsNamespace#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX p: <http://www.wikidata.org/prop/> PREFIX ps: <http://www.wikidata.org/prop/statement/> PREFIX pq: <http://www.wikidata.org/prop/qualifier/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> select * where { ?bioentity :hasMutatedVersionOf ?gene . ?gene :partOf wd

SPARQL - Insert data from remote endpoint

核能气质少年 提交于 2019-11-29 16:53:37
How can i query a remote endpoint (like endpoints of DBPedia or Wikidata ) and insert resulting triples in a local graph? So far, i know that there are commands like INSERT, ADD, COPY etc. which can be used for such tasks. What i don't understand is how to address a remote endpoint while updating my local graph. Could someone provide a minimum example or the main steps? I'm using Apache Jena Fuseki v2 on Windows and this is my query so far: PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX p: <http://www.wikidata.org/prop/> PREFIX wd: <http://www.wikidata.org/entity/> INSERT { GRAPH <?

How to get only the most recent value from a Wikidata property?

折月煮酒 提交于 2019-11-28 14:33:49
Suppose I want to get a list of every country (Q6256) and its most recently recorded Human Development Index (P1081) value. The Human Development Index property for the country contains a list of data points taken at different points in time, but I only care about the most recent data. This query will not work because it gets multiple results for each country (one for each Human Development Index data point): SELECT ?country ?countryLabel ?hdi_value ?hdi_date WHERE { ?country wdt:P31 wd:Q6256. OPTIONAL { ?country p:P1081 ?hdi_statement. ?hdi_statement ps:P1081 ?hdi_value. ?hdi_statement pq

Retrieving data from blank nodes in Wikidata

余生长醉 提交于 2019-11-28 14:30:56
I am attempting to retrieve data about the lifespans of certain people. This is problematic in cases of people that have lived a while ago. The dataset for e.g. Pythagoras seems to have a so called "blank node" for date of birth (P569) . But this blank node references another node earliest date (P1319) which has data I could work with just fine. But for some reason I am not able to retrieve that node. My first try looked like this , but somehow that results in a completly empty result set: SELECT DISTINCT ?person ?name ?dateofbirth ?earliestdateofbirth WHERE { ?person wdt:P31 wd:Q5. # This

Download Wikidata single entity - truthy

半世苍凉 提交于 2019-11-28 14:23:59
I would like to download Wikidata for a single entity. I know I can achieve using the URL, for example: https://www.wikidata.org/wiki/Special:EntityData/Q42.rdf Will give me Wikidata for Douglas Adams in RDF format. But this data is fully, meaning complete with meta-data such as qualifiers and references. I am interested in primary data only. Actually I am working on RDF Reification, and for that I need some sample non-RDF data which I can test my program on (like truthy Wikidata). I do not wish to download entire Wikidata dumps (Which I know are available in truthy format). .ttl?flavor=simple