daniel,

@wikidata @wikidata

I wonder if the RDF Wikidata dump is generated from the JSON Wikidata dump or if it s generated directly from the Wikidata database. In the case that the RDF Wikidata dump is generated from the JSON dump, what is the tool using from it?

#wikidata #SemanticWeb

pintoch,
@pintoch@mamot.fr avatar

@daniel @wikidata @wikidata I also replied on the wikidata-tech ML, but -Toolkit has functionality for this: https://github.com/Wikidata/Wikidata-Toolkit-Examples/blob/master/src/examples/RdfSerializationExample.java. However it's likely that it's not completely faithful to the current RDF serialization. Depending on your use case, it might be already usable.

daniel,

@wikidata @wikidata

Thank @pintoch, I have pending to review this tool and the other existing tools. What do you think that is the main difference between the output of the WIkidata Tookit and the current RDF serialization? Do they have different outputs regarding conditions like the described in https://mstdn.degu.cl/@daniel/111999382149914958 ?

pintoch,
@pintoch@mamot.fr avatar

@daniel @wikidata @wikidata yes, your particular example has been like this for years so this should easily be handled by WDTK.

daniel,

@wikidata @wikidata @pintoch One may think that to serialize a statement, only the information of the given statement is needed. However, this example shows the contrary; it is also needed to review other statements. Where are all this cases documented? Is there another similar case, or this is the only one?

pintoch,
@pintoch@mamot.fr avatar
abbe98,

@daniel it's not generated from the JSON dump. Both the JSON dump and the various RDF dumps are native implementations of the same "base dumper".

@wikidata @wikidata

daniel,

@abbe98
Thank you for the answer. From your answer and comments from other people, I understand that the base dumper is a component of Wikibase, the system that runs Wikidata. Wikibase has some modules that query the Wikibase database using SQL to map data from the relational model to either JSON or RDF. These two data mappings are independent.

I haven't explored the Wikibase code yet, but I guess these maps are defined algorithmically instead of using a declarative mapping language (e.g., RML). These maps implement some non-trivial logic, for example, to manage ranks and properties whose values exist but are unknown or do not exist.

@wikidata @wikidata

abbe98,

@daniel I don't think RML or any of its alternatives would be a good fit as Wikibase's ontology is mostly a "RDF wrapper" around its own concepts.

The little bit of declarative mapping I can think of is actually driven by Wikibase items/properties (things like canonicalUriProperty).

@wikidata @wikidata

daniel,

@wikidata @wikidata @abbe98 I don't understand what do you mean by "RDF wrapper." I guess that you mean that there is a straightforward mapping from the Wikibase data model to the RDF Wikidata data model. I agree that this is true in most cases. However, there is one case that requires to apply some rules. If the statement with subject s has a main snake of the form PropertyValueSnak(p, o) then we cannot know if the triple (s, p, o) resulting of the mapping must be asserted. Intuitively, it appears that it should be asserted only if one of the following two cases applies:

  1. If the statement rank is Preferred.

  2. If the statement rank is Normal and the subject s has no other statement whose main snak has the same property p, and its rank is Preferred.

I am not sure if there are more rules of this type. To be sure, I would like to see a declarative definition of it, including all these possible conditions. To my knowledge, the existing mappings are implemented in PHP and do not operate over the Wikibase data model, but over an optimized variant. So, they require more effort to be understood.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • wikidata@a.gup.pe
  • DreamBathrooms
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • GTA5RPClips
  • Durango
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • ngwrru68w68
  • tacticalgear
  • JUstTest
  • osvaldo12
  • tester
  • cubers
  • cisconetworking
  • mdbf
  • ethstaker
  • modclub
  • Leos
  • anitta
  • normalnudes
  • megavids
  • provamag3
  • lostlight
  • All magazines