Re: [Wikidata] Machine-readable Wikidata ontology/schema?

2016-06-23 Thread Nicolas Torzec
Thanks Stas and Markus.
I'm interested in computing various stats about Wikidata. For example, I want 
to compute the degree of interlinking between Wikidata and external databases, 
per entity type, per databases, etc. So I need a way to know which properties 
have an  external identifier as range, along with the name of the external 
database they point to. For example P345 is an external identifier to IMDB ; 
P2639 is an external identifier to Filmportal, etc.

Hence my question about machine-readable Wikidata schemas and data. Parsing the 
data is a no brainer since they are available as JSON and RDF. I already use 
the JSON dump since the RDF dump is marked as beta. However, I couldn't find a 
machine readable version of the Wikidata schemas, with a formal description of 
the classes, properties and how they relate to each others. I'd like to avoid 
scraping and/or hard-coding things myself.
Cheers.Nicolas.
--Nicolas TorzecYahoo Labs.




 

On Thursday, June 23, 2016 11:51 AM, Stas Malyshev 
 wrote:
 

 Hi!

> With the small number of properties, it should also be easy to get much
> of their data with a SPARQL query (depending on what you need). Does
> BlazeGraph support CONSTRUCT?

Yes. For example, this one: http://preview.tinyurl.com/hk5sudz

should produce a list of property definitions for WikibaseItem type.
These are already part of the dump, but they work as an illustration.

Right now there's no way to get data into TTL RDF serialization (maybe
in the future) but XML one works:
https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#Supported_formats
-- 
Stas Malyshev
smalys...@wikimedia.org

___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


  ___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Machine-readable Wikidata ontology/schema?

2016-06-23 Thread Markus Kroetzsch

On 23.06.2016 07:13, Stas Malyshev wrote:

Hi!


A quick search only returned those tables so far:
https://www.wikidata.org/wiki/Wikidata:List_of_properties/all


Any formal representation would work: OWL, etc.


There's basic OWL with Wikibase ontology here:
http://wikiba.se/ontology-1.0.owl
The properties can be found in the general dump (
https://dumps.wikimedia.org/wikidatawiki/entities/  )
described as outlined here:

https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Properties

There's no separate file, RDF, OWL or otherwise, with only properties,
AFAIK.


There is one for the initial (prototype) dumps [1], file 
wikidata-properties.nt.gz. Adjusting this to the RDF encoding used in 
the Wikidata SPARQL Service would be doable (mostly some URIs have 
changed, but there is a simple mapping).


With the small number of properties, it should also be easy to get much 
of their data with a SPARQL query (depending on what you need). Does 
BlazeGraph support CONSTRUCT?


In fact, depending on what you want to do with the data, you may find 
other formats that list all properties useful, esp. the property list 
used in SQID [2]. You can download the JSON file with the underlying 
data (see the link in the README of the github project for SQID).


Both our RDF dumps and the SQID file are generated using Wikidata 
Toolkit. You could use this too if you want custom exports that are not 
easy to get through the SPARQL endpoint.


Markus


[1] Most recent one is already two montsh old though; there seems to be 
a bug with the generator: 
http://tools.wmflabs.org/wikidata-exports/rdf/index.php?content=dump_download.php=20160425

[2] http://tools.wmflabs.org/sqid/#/browse?type=properties






--
Markus Kroetzsch
Faculty of Computer Science
Technische Universität Dresden
+49 351 463 38486
http://korrekt.org/

___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Machine-readable Wikidata ontology/schema?

2016-06-22 Thread Stas Malyshev
Hi!

> A quick search only returned those tables so far:
> https://www.wikidata.org/wiki/Wikidata:List_of_properties/all
> 
> 
> Any formal representation would work: OWL, etc.

There's basic OWL with Wikibase ontology here:
http://wikiba.se/ontology-1.0.owl
The properties can be found in the general dump (
https://dumps.wikimedia.org/wikidatawiki/entities/  )
described as outlined here:

https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format#Properties

There's no separate file, RDF, OWL or otherwise, with only properties,
AFAIK.
-- 
Stas Malyshev
smalys...@wikimedia.org

___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata