Page MenuHomePhabricator

create external triplestore for EntitySchema
Open, Needs TriagePublic

Description

At the moment it is not possible to get a RDF/JSON dump of available EntitySchemas. So one has to scrape the HTML to get at the code. Also serving queries for them is not possible.

At https://www.wikidata.org/wiki/Wikidata:Property_proposal/associated_shape JHeald writes:

According to posters on the wikidata-l list, viz. [https://lists.wikimedia.org/pipermail/wikidata/2019-May/013103.html], there is a standard RDF serialization for ShapeExpressions. It should be better ''either'' to include the RDF triples of these serializations directly within WDQS to describe a shape entity; ''or'' to load them into an associated triplestore, that could service federated queries from WDQS; ''rather than'' to try to keep and then maintain a parallel set of Q-items for shape expressions, that would expect each shape expression to be described in detail in duplicate. ShapeExpressions are supposed to describe themselves.

We think a dedicated triplestore is an excellent idea that would go a long way towards finishing T225701. This ticket is about setting up such a database and integrating it into the current EntitySchema services. However, as a database newbie I'm completely dependent on your opinion on this.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I'm realizing right now that changing Extension:EntitySchema to use a triplestore would make a general handling of RDF data possible, if there were further need for additional types.

Yes, batch parsing of EntitySchema's is still difficult. There are however some tricks one could use to not having to parse the HTML. There is the option under SpecialPages: EntitySchemaText. You'll need to add an EntitySchema number to get the EntitySchema in ShExC (e.g. E42). Subsequently json renderings of those ShExC can be obtained with parsers like shex-to-json can help in getting json of the schemas.

There is also wikishape that brings some GUI to the process. I am not sure how to get JSON here though maybe @Jelabra knows?

At this moment, wikishape doesn't include the option to convert to json yet but you can use rdfshape meanwhile.