Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Wikibase/Indexing/RDF Dump Format

From mediawiki.org
<Wikibase |Indexing
Translate this page
Languages:
Wikibase indexing
RDF export for wikibase indexing
Group:Search Platform
Team members:Stas Malyshev,Guillaume Lederrey
Lead:Stas Malyshev


Changes to the RDF mapping are subject to theStable Interface Policy.

This page describes the RDF dump and export format produced by Wikidata and used for export and indexing purposes.Note that while it is close to theformat used by theWikidata Toolkit, it is not the same code and not the same format.While we strive to keep divergence to a minimum, there may be differences, and one should use documentation only for the format that is actually being consumed.

This document describes the RDF dump as it can be downloaded from theWikimedia dump source, and while it can be used to create queries for the Wikidata Query Service, the service can have small differences in how the data there look like.See theWDQS data differences chapter for the full list.

The canonical URI of the Wikibase RDF ontology ishttp://wikiba.se/ontology.The current version can be found athttp://wikiba.se/ontology-1.0.owl.

Changes to the RDF mapping are subject to theStable Interface Policy.

Data model

[edit]
The data used in the description of a single item

The RDF format is a binding for theWikibase data model and it represents an export format for it.That means, in particular, that if the data model changes, the export format will be changed accordingly.This document will be updated for such changes.The following description assumes familiarity with the data model and the terminology used.

This RDF binding is based on the one designed for the Wikidata Toolkit by Denny Vrandecic and Markus Krötzsch, seehttps://web.archive.org/web/20190313052004/http://korrekt.org/papers/Wikidata-RDF-export-2014.pdf.

The following description uses prefixes to describe the IRIs of the RDF resources mentioned.See thePrefixes chapter for the full description.All examples below are given in theTurtle format.

Versions

[edit]

The version of the data model is specified byschema:softwareVersion predicate of theschema:Dataset node, which is either dump node for the dump or entity data node (wdata:) for single entity page.

Released versions:

VersionDescription
0.0.1Initial version.
0.0.2Changed WKT coordinate order (T130049)
0.0.3Added page props option towdata: (T129046)
0.0.4Added unit conversion & normalisation support (T117031)
0.0.5Added quantities without bounds. (T115269)
0.1.0Changed link encoding (T131960)
1.0.0Removed-beta from the ontology prefix (T112127). The RDF mapping is now considered stable.

Header

[edit]

For the RDF dump, there is the header nodewikibase:Dump containing information about the license, the software version of the generator and the date the data was produced.In single-entity export, this data is attached to the data node (see below).

Example header:

wikibase:Dumpaschema:Dataset;cc:license<http://creativecommons.org/publicdomain/zero/1.0/>;schema:softwareVersion"1.0.1";schema:dateModified"2015-03-21T06:03:55Z"^^xsd:dateTime.
  • cc:license - specifies the IRI of the license that applies to the whole RDF document.
  • schema:softwareVersion - specifies which version of the dump format is being used (currently1.0.0), will be updated when format changes, once the format is out of the beta period. The version updates will be done along the lines ofsemantic versioning, with major changes being BC breaking ones, minor being major BC-compatible changes and patch part changes on minor tweaks.
  • schema:dateModified - specifies the date of the dump's data validity. Some data that is contained in a dump may be more recent than this date, but it is guaranteed that no data in the dump is older than this date. The date should be close to the time of the oldest data contained in the dump, but for technical reasons may not be exactly the same as the time of the oldest data in the dump.

Entity representation

[edit]

The entity is described in two nodes - data node and entity node.For entity Q1, data node iswdata:Q1 and entity node iswd:Q1.

Data node describes the metadata about the entity record in the Wikibase - i.e. data which are not part of the entity's information but instead describe the status of the entity inside Wikibase.It has type ofschema:Dataset and contains the following metadata:

  • Information about the entity revision (schema:version) – this is a counter that increases with each modification of the entity data
  • Last modification time of the entity data (schema:dateModified) – as anxsd:dateTime timestamp
  • Link to the entity node withschema:about predicate

Example:

wdata:Q2schema:version"59"^^xsd:integer;schema:dateModified"2015-03-18T22:38:36Z"^^xsd:dateTime;aschema:Dataset;schema:aboutwd:Q2.

Entity node describes the actual entity data and has typewikibase:Item orwikibase:Property depending on the kind of entity.Other entity types can be introduced in the future.

Entity description includes the following:

  • Entity labels - the main name of the entity. Labels are defined asschema:name,rdfs:label andskos:prefLabel predicates with objects being language-tagged string literals.
  • Entity aliases - the secondary names of the entity. Aliases are defined asskos:altLabel predicates with objects being language-tagged string literals.
  • Entity description - the longer description of the entity. Defined asschema:description predicates with objects being language-tagged string literals.
  • Truthy statements (see below)
  • Predicates linking it to full statements

Example of the entity definition:

wd:Q3awikibase:Item;rdfs:label"The Universe"@en;skos:prefLabel"The Universe"@en;schema:name"The Universe"@en;schema:description"The Universe is big"@en;skos:altLabel"everything"@en;wdt:P2wd:Q3;wdt:P7"value1","value2";p:P2wds:Q3-4cc1f2d1-490e-c9c7-4560-46c3cce05bb7;p:P7wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37,wds:Q3-45abf5ca-4ebf-eb52-ca26-811152eb067c.

Page properties

[edit]

Entity node can also carry additional information about the entity, such as number of links or statements.

The data is sourced frompage properties and can be specified in config file.For example:

wdata:Q42aschema:Dataset;schema:aboutwd:Q42;wikibase:statements"275"^^xsd:integer;wikibase:identifiers"206"^^xsd:integer;wikibase:sitelinks"116"^^xsd:integer.

wikibase:statements specifies how many statements this entity has,wikibase:identifiers specifiers the number of statements withExternal ID values, andwikibase:sitelinks specifies the number ofsitelinks.Additional statements can be introduced in the future.

Items

[edit]

Entities that represent items have the common entity data as described above, plus can havesitelinks attached to them, as described below.

Properties

[edit]

Entities that represent properties additionally feature the property type usingwikibase:propertyType predicate.The object of the predicate is the property type described inValue representation below, withwikibase: prefix and each word capitalised, with no separators.I.e.,wikibase-item becomeswikibase:WikibaseItem.

Each property is also linked to thepredicates that are derived from it.Example:

wd:P22awikibase:Property;rdfs:label"Item property"@en;wikibase:propertyTypewikibase:WikibaseItem;wikibase:directClaimwdt:P22;wikibase:claimp:P22;wikibase:statementPropertyps:P22;wikibase:statementValuepsv:P22;wikibase:qualifierpq:P22;wikibase:qualifierValuepqv:P22;wikibase:referencepr:P22;wikibase:referenceValueprv:P22;wikibase:novaluewdno:P22.

The property predicates also have type definitions:

prv:P22aowl:ObjectProperty.wdt:P22aowl:DatatypeProperty.

The type depends on the type of the original property - whether itsvalue is literal (DatatypeProperty) or IRI (ObjectProperty).However,p:,psv: ,pqv: andprv: predicates would always beowl:ObjectProperty.

Note that wdno:P22 mentioned above is not a predicate, unlike others, but a class.See the full description of it inNovalue section.

Lexemes

[edit]

Please see full description atLexeme RDF mapping.

Lexemes are represented according toLexeme RDF mapping.Example:

wd:L64723aontolex:LexicalEntry;# lemmawikibase:lemma"hard"@en;# languagedct:languagewd:Q1860;# lexical categorywikibase:lexicalCategorywd:Q34698;# statementswdt:P2wd:Q3;wdt:P7"value1","value2";p:P2wds:Q3-4cc1f2d1-490e-c9c7-4560-46c3cce05bb7;p:P7wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37,wds:Q3-45abf5ca-4ebf-eb52-ca26-811152eb067c;# formsontolex:lexicalFormwd:L64723-F1;# sensesontolex:sensewd:L64723-S1.

MediaInfo

[edit]

Please see full description atMediaInfo RDF mapping.

MediaInfo entities are represented according toMediaInfo RDF mapping.Example:

@prefixsdc:<https://commons.wikimedia.org/entity/>.@prefixsdcdata:<https://commons.wikimedia.org/wiki/Special:EntityData/>.@prefixsdcs:<https://commons.wikimedia.org/entity/statement/>.@prefixsdcref:<https://commons.wikimedia.org/reference/>.@prefixsdcv:<https://commons.wikimedia.org/value/>.sdcdata:M6661797aschema:Dataset;schema:aboutsdc:M6661797;cc:license<http://creativecommons.org/publicdomain/zero/1.0/>;schema:softwareVersion"1.0.0";schema:version"407884644"^^xsd:integer;schema:dateModified"2020-03-29T15:25:01Z"^^xsd:dateTime.sdc:M6661797awikibase:Mediainfo,schema:MediaObject,schema:ImageObject;schema:encodingFormat"image/jpeg";schema:contentUrl<https://upload.wikimedia.org/wikipedia/commons/6/64/Douglas_adams_portrait.jpg>;schema:contentSize"38890"^^xsd:integer;schema:height"386"^^xsd:integer;schema:width"600"^^xsd:integer;schema:caption"Photo de Douglas Adams."@fr;rdfs:label"Photo de Douglas Adams."@fr;schema:caption"Douglas Adams' portrait"@en;rdfs:label"Douglas Adams' portrait"@en;schema:caption"Foto di Douglas Adams"@it;rdfs:label"Foto di Douglas Adams"@it;wdt:P180wd:Q42;p:P180sdcs:M6661797-25026d3f-444c-1915-1d5b-c29dbad8cbec.sdcs:M6661797-25026d3f-444c-1915-1d5b-c29dbad8cbecawikibase:Statement,wikibase:BestRank;wikibase:rankwikibase:PreferredRank;ps:P180wd:Q42.

This example demonstrates the MediaInfo data on wikimedia commons when used in federation with wikidata.

Statement types

[edit]

The RDF format represents statements in two forms - truthy and full statements.

Truthy statements

[edit]

Truthy statements represent statements that have the best non-deprecated rank for a given property.

Namely, if there is a preferred statement for property P2, then only preferred statements for P2 will be considered truthy.

Otherwise, all normal-rank statements for P2 are considered truthy.

Truthy statement predicates have the prefixwdt: with the property name (e.g.wdt:P2) and the object is the simple value (see below) for the statement.

The qualifiers are ignored.

If the value has simple value normalisation (currently true only for external ID), normalised value is listed underwdtn: prefix, e.g.wdtn:P2.

Full statements

[edit]

Full statements represent all data about the statement in the system.Full statement is represented as separate node, with prefixwds: with the id of the statement (e.g.wds:Q3-4cc1f2d1-490e-c9c7-4560-46c3cce05bb7).

There is no guaranteed format or meaning to the statement id.

The statements are linked to the entity with the predicate with prefixp: and the name of the property (e.g.p:P2).

Statement representation

[edit]
WarningWarning:Itis possible that a statement refers to a property or item that no longer exists. Therefore you should not assume the predicates and objects are always defined.

The statement node represents a single statement about the entity.It has typewikibase:Statement.The statement can contain the rank, the simple value (see below) of the statement, the link to the full value, the qualifiers and the references.

The statement rank is represented by the predicatewikibase:rank and the object being one of:wikibase:NormalRank ,wikibase:PreferredRank,wikibase:DeprecatedRank.

The statement that has the best rank for the property (i.e., preferred if there are any preferred statements in the property, otherwise normal) is also has type ofwikibase:BestRank.

The simple value is represented by the predicate with prefixps: and the name of the property (e.g.ps:P2) and the object being the simple value.

The full value (if required by the type) is represented by the predicate with prefixpsv: (e.g.psv:P2) and the object being the full value node.

The statement always has no more than one value, but can have multiple qualifiers and references.

Qualifiers

[edit]

The qualifiers are represented by predicates with prefixpq: and the name of the property (e.g.pq:P2) and the object being the simple value of the qualifier.

The full value (if required by the type) is represented by the predicate with prefixpqv: (e.g.pqv:P2) and the object being the full value node.

References

[edit]

References are represented by the predicateprov:wasDerivedFrom with the object being the reference node (see below).

Example of the statement:

wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37awikibase:Statement,wikibase:BestRank;ps:P2wd:Q3;wikibase:rankwikibase:PreferredRank;pq:P8"-13000000000-01-01T00:00:00Z"^^xsd:dateTime;pqv:P8wdv:382603eaa501e15688076291fc47ae54;prov:wasDerivedFromwdref:87d0dc1c7847f19ac0f19be978015dfb202cf59a,wdref:d95dde070543a0e0115c8d5061fce6754bb82280.

Reference representation

[edit]

References represent provenance information about statements.

Reference is represented as node, with prefixwdref: and the local name being the hash derived from the reference contents (e.g.wdref:d95dde070543a0e0115c8d5061fce6754bb82280).The exact value of the hash is not guaranteed beyond the fact that the same references (i.e. ones with identical content) will generate the same hash, and the different one will generate the different one.The same reference (i.e. reference having the same properties with the same values) will be usually represented with single node, though duplicate reference nodes are possible in the data.

The type of the node is awikibase:Reference.

The reference values are represented the same as statement values, with simple values using predicates withpr: prefix (e.g.pr:P2) and full values with prefixprv: (e.g.prv:P2) and the object being the full value node.Unlike statements, references can have any number of values.

Example of the reference node:

wdref:d95dde070543a0e0115c8d5061fce6754bb82280awikibase:Reference;pr:P7"Some data";pr:P8"1976-01-12T00:00:00Z"^^xsd:dateTime;prv:P8wdv:b74072c03a5ced412a336ff213d69ef1.

Value representation

[edit]

In the RDF format, the values are represented as two forms - simple value and full value.Simple value is always a literal or IRI, and is used as direct value that is convenient to search, index and match.The full value contains additional information about the value, such as ranges, precision, calendar used, etc.Note that while for many queries simple values will be enough, for other, more complex values, only full values will be adequate.

If the statement has a value (i.e. is not set tonovalue) then the simple value will always be present.

Full values are represented as nodes having prefixwdv: and the local name being the hash of the value contents (e.g.wdv:382603eaa501e15688076291fc47ae54).There is no guarantee of the value of the hash except for the fact that different values will be represented by different hashes, and same value mentioned in different places will have the same hash.Value node has typewikibase:Value.The content of the node is defined by the type of the value (see below).

Example of the value node:

wdv:b74072c03a5ced412a336ff213d69ef1awikibase:TimeValue;wikibase:timeValue"+1976-01-12T00:00:00Z"^^xsd:dateTime;wikibase:timePrecision"11"^^xsd:integer;wikibase:timeTimezone"0"^^xsd:integer;wikibase:timeCalendarModel<http://www.wikidata.org/entity/Q1985727>.

The following describes the handling of each kind of value, depending on the type of the value and the type of the property.Note that not all aspects of the data model are represented in RDF currently, some aspects that are currently unused (such as units or before/after values for dates) are omitted since they currently do not carry any useful information.This may change in the future if/when these aspects come into use by Wikidata.

String

[edit]

Strings have value typestring and property typestring.

String is represented as a string literal.Strings only have simple value.

Commons media

[edit]

Media oncommons: have value typestring and property typecommonsMedia.

Commons media is represented as an IRI with the full Commons resource URL, derived from the Commons filename in the underlying data item.E.g.:<http://commons.wikimedia.org/wiki/Special:FilePath/Universe%20Photo.svg>.It has only simple value.

URL

[edit]

URL values have value typestring and property typeurl.

URL is represented as a an IRI matching the URL string (e.g.<http://www.wikidata.org/>).It has only simple value.

External ID

[edit]

External ID values have value typestring and property typeexternal-id.They are represented by a string literal.It has only simple value.

If the property has a formatter URI for RDF configured (on Wikidata:formatter URI for RDF resource(P1921)), the RDF will also have normalised value, e.g.:

wd:Q123wdt:P234"External-ID";wdtn:P234<http://external.example.com/reference/External-ID>

Wikibase Entity ID

[edit]

Wikibase Entity ID values have value typewikibase-entityid and property typewikibase-item.

The entity is represented by its IRI, e.g.wd:Q2.It has only simple value.

Monolingual text

[edit]

Monolingual text values have value typemonolingualtext and property typemonolingualtext.

The text is represented as a string literal with language tag.It has only simple value.

Globe coordinate

[edit]

Coordinate text values have value typeglobecoordinate and property typeglobe-coordinate.

The simple value of the coordinate is the WKT string with the coordinates, with typegeo:wktLiteral, e.g.:"Point(35.3 12.93)"^^geo:wktLiteral.The order of the coordinates in WKT is longitude, latitude (since format version 0.0.2).

The full value has latitude, longitude and precision as double, and the globe as IRI.

Example:

wdv:a10564107110b2d5739b8fe235cddf73awikibase:GlobecoordinateValue;wikibase:geoLatitude"12.933333333333"^^xsd:double;wikibase:geoLongitude"35.3"^^xsd:double;wikibase:geoPrecision"0.000277778"^^xsd:double;wikibase:geoGlobe<http://www.wikidata.org/entity/Q2>.

Quantity

[edit]

Quantity values have value typequantity and property typequantity.

The simple value of the quantity is the specified amount, as a decimal literal.

The full value includes amount, unit URI (the default for unit-less values beinghttp://www.wikidata.org/entity/Q199), and optionally upper and lower bound.If no upper and lower bound are given, the uncertainty of the quantity is undefined.Exact values are represented by quantities that have the same value for amount, upper bound and lower bound.

Example:

wdv:cb213eea7a0b90d1d7f65c6eabfab9daawikibase:QuantityValue;wikibase:quantityAmount"+123"^^xsd:decimal;wikibase:quantityUpperBound"+124"^^xsd:decimal;wikibase:quantityLowerBound"+122"^^xsd:decimal;wikibase:quantityUnit<http://www.wikimedia.org/entity/Q199>.

Time

[edit]

Time values have value typetime and property typetime.

The simple value of the time value is either datetime value of typexsd:dateTime, if the value can be converted to Gregorian date in ISO format, or a string as represented in the database, if not.Thexsd:dateTime dates followXSD 1.1 standard, which uses theproleptic Gregorian calendar, and represents the year 1 BCE as +0000.This is in contrast theJSON representation of Julian and Gregorian dates, which follows the traditional year numbering, representing the year 1 BCE as -0001.

The full value includes the simple value above underwikibase:timeValue,precision and timezone as integers and calendar model as IRI.Note that the calendar model is the original values calendar model even ifwikibase:timeValue was converted to Gregorian.

Example:

wdv:85374678f22bda99efb44a5617d76e51awikibase:Time;wikibase:timeValue"+1948-04-12T00:00:00Z"^^xsd:dateTime;wikibase:timePrecision"11"^^xsd:integer;wikibase:timeTimezone"0"^^xsd:integer;wikibase:timeCalendarModel<http://www.wikidata.org/entity/Q1985727>.

Normalised values

[edit]

Some values can be represented in several forms, depending on the purpose.For example, length can be expressed in different units - feet, inches, meters, miles, etc.In order to provide means to unify these forms and thus make data more friendly for automatic processing, the normalised values are introduced, which represent diverse data in a unified way.

Right now, the only value normalisation that is supported is converting units for quantities into base units - e.g. length to meters.In the future, more units and more normalisations may be added, which will be documented here.The conversion table is availableon the Mediawiki gerrit if needed.

The only normalised simple values are external IDs (see below).

Normalised quantity

[edit]

Normalised quantity values are value nodes that are parallel to the original data nodes but represented in base units.They are connected to their parent nodes by predicates with prefix having "v" replaced with "n" - i.e.psn:,prn: andpqn:, for example:

wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37awikibase:Statement,wikibase:BestRank;ps:P8"123"^^xsd:decimal;psv:P8wdv:382603eaa501e15688076291fc47ae54;psn:P8wdv:85374998f22bda54efb44a5617d76e51.

Original quantity value is connected to the normalised value bywikibase:quantityNormalized predicate:

wdv:382603eaa501e15688076291fc47ae54awikibase:QuantityValue;wikibase:quantityAmount"+123"^^xsd:decimal;wikibase:quantityUpperBound"+124"^^xsd:decimal;wikibase:quantityLowerBound"+122"^^xsd:decimal;wikibase:quantityUnit<http://www.wikidata.org/entity/Q218593>;wikibase:quantityNormalizedwdv:85374998f22bda54efb44a5617d76e51.

The normalised value haswikibase:quantityNormalized pointing to itself.

If the value is already normalised - i.e. is expressed in base units - then both "v" and "n" predicates point to the same value, andwikibase:quantityNormalized for this value points to itself.

Quantities with no units or with units that are not normalisable (have no base unit they can be reduced to) do not have normalised predicates and normalised values and do not includewikibase:quantityNormalized.

The recommendation is to have no more than one base unit per property.Base units depend on Wikibase configuration and usually are chosen to represent universally accepted standard units, such as SI units.

Normalised External ID

[edit]

For external IDs, normalisation converts string value to URL, if the URL formatter for that purpose is defined in property data (viacanonicalUriProperty setting), then the normalised value will be listed aswdtn: value for truthy values, and as normalised value for the statements inpsn:,prn: andpqn: predicates, depending on the context where the value appears.

Special values

[edit]

Wikibase data model has two special kinds of snaks - PropertySomeValueSnak, specifying a value that exists but whose identity or value is unknown, and PropertyNoValueSnak, specifying that a value does not exist.

Somevalue

[edit]

Unknown value is represented as RDF blank node in both simplified and full statements:

wd:Q3awikibase:Item,wdt:P2_:genid1.wds:Q3-45abf5ca-4ebf-eb52-ca26-811152eb067cawikibase:Statement;ps:P2_:genid2;wikibase:rankwikibase:NormalRank.

Novalue

[edit]

Novalue is represented not by a regular value but as a class of the entity or statement or reference, with prefixwdno: and the name of the property.Example:

wd:Q3awikibase:Item,wdno:P7.wds:Q3-45abf5ca-4ebf-eb52-ca26-811152eb777cawikibase:Statement,wdno:P7;wikibase:rankwikibase:NormalRank.

The entity has awdno: class if it has a truthynovalue statement for that property.

Novalue in the main snak or qualifiers of a statement corresponds to awdno: class on the statement node, andnovalue in a reference snak corresponds to awdno: class on the reference node.

The classes forwdno: are defined as follows:

wdno:P2aowl:Class;owl:complementOf_:genid1._:genid1aowl:Restriction;owl:onPropertywdt:P2;owl:someValuesFromowl:Thing.

Sitelinks

[edit]

The links are represented as set of predicates describing the link URL.The type of the node isschema:Article and it linked with the entity viaschema:about predicate.

Badges are described withwikibase:badge predicates.schema:name predicate holds the plain-text name of the article, in the language of the linked wiki.

Example:

<https://en.wikipedia.org/wiki/Duck>aschema:Article;schema:aboutwd:Q3;schema:inLanguage"en";schema:isPartOf<https://en.wikipedia.org/>;schema:name"Duck"@en;wikibase:badgewd:Q5.<https://en.wikipedia.org/>wikibase:wikiGroup"wikipedia".

The subject URL is composed from the language site prefix and the article name, URL-encoded according toRFC 3986, e.g.:

<https://ru.wikipedia.org/wiki/%D0%A3%D1%82%D0%BA%D0%B0>

More specifically, encoding used is as follows:

  1. Normalise the title by replacing spaces with underscores (_).
  2. ApplywfUrlencode() function, which percent-encodes all non-alphanumeric characters except ";:@$!*(),/-_~".

Redirects

[edit]

Redirected entities are implemented asowl:sameAs predicates, for example if Q6 redirects to Q1, the dump would be:

wd:Q6owl:sameAswd:Q1.

Prefixes used

[edit]

The prefixes are used in RDF formats that allow short prefixes (such as Turtle and RDF).For other formats, the full URL is used.

All prefix URLs that do not contain hostname are prefixed with the hostname of the generating wiki.All prefix URLs that contain hostname are fixed and do not depend on generating wiki.

PrefixFull URLUsageExample
wikibase:http://wikiba.se/ontology#Wikibase ontology
wd:Q2awikibase:Item
Nodes
wdata:/Special:EntityData/Data set describing certain entity
wdata:Q2schema:aboutwd:Q2.
wd:/entity/Wikibase entity - item or property.
wd:Q2p:P9wds:Q2-82a6e009-4f93-28dc-3555-38bbfc3afe6a
wds:/entity/statement/Statement node, describes claim about entity.
wds:Q2-a4078553-4ec1-a64a-79e7-c5b5e17b2782awikibase:Statement
wdv:/value/Value node
wdv:87d0dc1c7847f19ac0f19be978015dfb202cf59aawikibase:Value
wdref:/reference/Reference node
wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37prov:wasDerivedFromwdref:87d0dc1c7847f19ac0f19be978015dfb202cf59a.wdref:87d0dc1c7847f19ac0f19be978015dfb202cf59aawikibase:Reference.
Predicates
wdt:/prop/direct/Truthy assertions about the data, links entity to value directly.
wd:Q2wdt:P9<http://acme.com/>
wdtn:/prop/direct-normalized/Truthy assertions about the data, links entity tonormalised value directly.
wd:Q2wdtn:P9<http://acme.com/ABCDE>
p:/prop/Links entity to statement
wd:Q2p:P9wds:Q2-82a6e009-4f93-28dc-3555-38bbfc3afe6awd
wdno:/prop/novalue/Class to use when the entity hasnovalue for this property.
wd:Q2awdno:P9.
ps:/prop/statement/Links value to statement
wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37ps:P8"-13000000000-01-01T00:00:00Z"^^xsd:dateTime
psv:/prop/statement/value/Links deep value to statement
wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37psv:P8wdv:87d0dc1c7847f19ac0f19be978015dfb202cf59a
psn:/prop/statement/value-normalized/Links normalised value to statement node
wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37psn:P8wdv:87d0dc1c7847f19ac0f19be978015dfb202cf59a
pq:/prop/qualifier/Links qualifier to statement node
wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37pq:P8"-13000000000-01-01T00:00:00Z"^^xsd:dateTime
pqv:/prop/qualifier/value/Links qualifier deep value to statement node
wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37pqv:P8wdv:87d0dc1c7847f19ac0f19be978015dfb202cf59a
pqn:/prop/qualifier/value-normalized/Links normalised qualifier value to statement node
wds:Q3-24bf3704-4c5d-083a-9b59-1881f82b6b37pqn:P8wdv:87d0dc1c7847f19ac0f19be978015dfb202cf59a
pr:/prop/reference/Links reference to value
wdref:87d0dc1c7847f19ac0f19be978015dfb202cf59apr:P8"-13000000000-01-01T00:00:00Z"^^xsd:dateTime
prv:/prop/reference/value/Links reference to deep value
wdref:87d0dc1c7847f19ac0f19be978015dfb202cf59aprv:P8wdv:87d0dc1c7847f19ac0f19be978015dfb202cf59a
prn:/prop/reference/value-normalized/Links reference to normalised value
wdref:87d0dc1c7847f19ac0f19be978015dfb202cf59aprn:P8wdv:87d0dc1c7847f19ac0f19be978015dfb202cf59a

Standard prefixes used:

PrefixFull URL
rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs:http://www.w3.org/2000/01/rdf-schema#
xsd:http://www.w3.org/2001/XMLSchema#
owl:http://www.w3.org/2002/07/owl#
skos:http://www.w3.org/2004/02/skos/core#
schema:http://schema.org/
prov:http://www.w3.org/ns/prov#
geo:http://www.opengis.net/ont/geosparql#

Full list of prefixes

[edit]

This list can be used for queries in SPARQL:

PREFIXbd:<http://www.bigdata.com/rdf#>PREFIXcc:<http://creativecommons.org/ns#>PREFIXdct:<http://purl.org/dc/terms/>PREFIXgeo:<http://www.opengis.net/ont/geosparql#>PREFIXhint:<http://www.bigdata.com/queryHints#>PREFIXontolex:<http://www.w3.org/ns/lemon/ontolex#>PREFIXowl:<http://www.w3.org/2002/07/owl#>PREFIXprov:<http://www.w3.org/ns/prov#>PREFIXrdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIXrdfs:<http://www.w3.org/2000/01/rdf-schema#>PREFIXschema:<http://schema.org/>PREFIXskos:<http://www.w3.org/2004/02/skos/core#>PREFIXxsd:<http://www.w3.org/2001/XMLSchema#>PREFIXp:<http://www.wikidata.org/prop/>PREFIXpq:<http://www.wikidata.org/prop/qualifier/>PREFIXpqn:<http://www.wikidata.org/prop/qualifier/value-normalized/>PREFIXpqv:<http://www.wikidata.org/prop/qualifier/value/>PREFIXpr:<http://www.wikidata.org/prop/reference/>PREFIXprn:<http://www.wikidata.org/prop/reference/value-normalized/>PREFIXprv:<http://www.wikidata.org/prop/reference/value/>PREFIXpsv:<http://www.wikidata.org/prop/statement/value/>PREFIXps:<http://www.wikidata.org/prop/statement/>PREFIXpsn:<http://www.wikidata.org/prop/statement/value-normalized/>PREFIXwd:<http://www.wikidata.org/entity/>PREFIXwdata:<http://www.wikidata.org/wiki/Special:EntityData/>PREFIXwdno:<http://www.wikidata.org/prop/novalue/>PREFIXwdref:<http://www.wikidata.org/reference/>PREFIXwds:<http://www.wikidata.org/entity/statement/>PREFIXwdt:<http://www.wikidata.org/prop/direct/>PREFIXwdtn:<http://www.wikidata.org/prop/direct-normalized/>PREFIXwdv:<http://www.wikidata.org/value/>PREFIXwikibase:<http://wikiba.se/ontology#>

Ontology

[edit]

This compiles the list of all objects and predicates that are internal to the format.For the meaning of the prefixes, see the prefixes list.

Objects

[edit]
NameUsageContext
wikibase:ItemWikibase itemType for wd:Q123 describing item
wikibase:PropertyWikibase propertyType for wd:P123 describing property
wikibase:LexemeWikibase lexemeType for wd:L123 describing lexeme
wikibase:FormWikibase lexeme formType for wd:L123-F1 describing form
wikibase:SenseWikibase lexeme senseType for wd:L123-S1 describing sense
wikibase:StatementStatement about the entityType for wds:1234 describing statement
wikibase:ReferenceReference nodeType for wdref:1234 describing reference
wikibase:TimeValueValue node representing time valueType for wdv:1234 describing time value
wikibase:QuantityValueValue node representing quantity valueType for wdv:1234 describing quantity value
wikibase:GlobecoordinateValueValue node representing coordinate valueType for wdv:1234 describing coordinate value
wikibase:DumpNode describing the dump datatsetUsed in dump header to describe metadata for whole dump
wikibase:PreferredRankRepresents preferred rank for the statementUsed as object of wikibase:rank
wikibase:NormalRankRepresents normal rank for the statementUsed as object of wikibase:rank
wikibase:DeprecatedRankRepresents deprecated rank for the statementUsed as object of wikibase:rank
wikibase:BestRankRepresents statement that has best rank for the property - i.e. suitable for inclusion as truthy statementUsed as type of wikibase:Statement
wikibase:WikibaseItemEntity reference typeUsed as object of wikibase:propertyType
wikibase:CommonsMediaCommons media reference typeUsed as object of wikibase:propertyType
wikibase:ExternalIdExternal identifier typeUsed as object of wikibase:propertyType
wikibase:GlobeCoordinateGeo coordinate typeUsed as object of wikibase:propertyType
wikibase:MonolingualtextSingle language text valueUsed as object of wikibase:propertyType
wikibase:QuantityQuantity typeUsed as object of wikibase:propertyType
wikibase:StringString valueUsed as object of wikibase:propertyType
wikibase:TimeTime valueUsed as object of wikibase:propertyType
wikibase:UrlURL reference typeUsed as object of wikibase:propertyType


Predicates

[edit]

Italicised names mean that any property name can be substituted instead of example name P123.

NameUsageDomainRange
wdt:P123Link entity to truthy statement valuewikibase:Item|wikibase:PropertySimple value
wdtn:P123Link entity to normalised truthy statement valuewikibase:Item|wikibase:PropertySimple value
p:P123Link entity to statementwikibase:Item|wikibase:Propertywikibase:Statement
ps:P123Link statement to simple valuewikibase:StatementSimple value
pr:P123Link reference to simple valuewikibase:ReferenceSimple value
pq:P123Link statement to qualifier valuewikibase:StatementSimple value
psv:P123Link statement to value nodewikibase:Statementwikibase:Value
psn:P123Link statement to normalised value nodewikibase:Statementwikibase:Value
prv:P123Link reference to value nodewikibase:Referencewikibase:Value
prn:P123Link reference to normalised value nodewikibase:Referencewikibase:Value
pqv:P123Link statement to qualifier value nodewikibase:Statementwikibase:Value
pqn:P123Link statement to normalised qualifier value nodewikibase:Statementwikibase:Value
wikibase:rankSpecifies rank of the statementwikibase:StatementOne of the rank objects above
wikibase:badgeBadge attached to a sitelinkschema:Articlewikibase:Item - URL of the badge
wikibase:propertyTypeProperty type of the property entitywikibase:PropertyOne of the property type objects above
wikibase:directClaimLinks property entity to direct claim predicatewikibase:Propertywdt:P123
wikibase:directClaimNormalizedLinks property entity to normalised direct claim predicatewikibase:Propertywdtn:P123
wikibase:claimLinks property entity to claim/statement predicatewikibase:Propertyp:P123
wikibase:statementPropertyLinks property entity to statement simple value predicatewikibase:Propertyps:P123
wikibase:statementValueLinks property entity to statement full value predicatewikibase:Propertypsv:P123
wikibase:statementValueNormalizedLinks property entity to statement normalised value predicatewikibase:Propertypsn:P123
wikibase:qualifierLinks property entity to qualifier simple value predicatewikibase:Propertypq:P123
wikibase:qualifierValueLinks property entity to qualifier full value predicatewikibase:Propertypqv:P123
wikibase:qualifierValueNormalizedLinks property entity to qualifier normalised value predicatewikibase:Propertypqn:P123
wikibase:referenceLinks property entity to reference simple value predicatewikibase:Propertypr:P123
wikibase:referenceValueLinks property entity to reference full value predicatewikibase:Propertyprv:P123
wikibase:referenceValueNormalizedLinks property entity to reference normalised value predicatewikibase:Propertyprn:P123
wikibase:hasViolationForConstraintLinks statement violating a constraint to the constraint statementwikibase:Statementwikibase:Statement
wikibase:lemmaLinks Wikibase lexeme with the lemma textwikibase:LexemeSimple string value
wikibase:lexicalCategoryLinks Wikibase lexeme with its lexical category itemwikibase:Lexemewikibase:Item
wikibase:grammaticalFeatureLinks Wikibase lexeme form with its grammatical featureswikibase:Form/ontolex:Formwikibase:Item

The following predicates are used in deep values for the values of specific types.All these predicates have the domain ofwikibase:Value and the range depending on type below.

Predicates for Globecoordinate

[edit]
NameTypeMeaning
wikibase:geoLatitudexsd:doubleLatitude component of the coordinate
wikibase:geoLongitudexsd:doubleLongitude component of the coordinate
wikibase:geoPrecisionxsd:doublePrecision of the coordinates
wikibase:geoGlobeIRIThe URL of the globe, e.g.http://www.wikidata.org/entity/Q2 (Earth)

Predicates for Quantity

[edit]
NameTypeMeaning
wikibase:quantityAmountxsd:decimalThe specified amount
wikibase:quantityUpperBoundxsd:decimalThe upper limit of the value range
wikibase:quantityLowerBoundxsd:decimalThe lower limit of the value range
wikibase:quantityUnitIRIThe unit of measurement, for unit-less quantities ishttp://www.wikidata.org/entity/Q199 (i.e. "1")
wikibase:quantityNormalizedIRIPoints to the normalised value, if exists.

Predicates for Time

[edit]
NameTypeMeaning
wikibase:timeValuexsd:dateTime|stringGregorian time or string if the value can not be represented as Gregorian time
wikibase:timePrecisionxsd:integerTime precision constant
wikibase:timeTimezonexsd:integerTimezone offset from UTC in minutes
wikibase:timeCalendarModelIRIURL of the calendar used, e.g.http://www.wikidata.org/entity/Q1985727 (Gregorian)

WDQS data differences

[edit]

TheWikidata query service has the data in the format described above, but there are small differences that can be important while writing SPARQL queries:

  1. Types (a orrdf:type) forwikibase:Item,wikibase:Statement,wikibase:Reference ,wikibase:Lexeme,wikibase:Form,wikibase:Sense are currently omitted for performance reasons.
    • To filter for items, you can usewikibase:sitelinks [] instead ofa wikibase:Item (only items have a number of sitelinks).
    • To filter for statements, you can usewikibase:rank [] instead ofa wikibase:Statement (only statements have a rank).
    • To filter for references, you can use[] prov:wasDerivedFrom ?reference instead of?reference a wikibase:Reference, but note that this may return a reference more than once. (Usually, you’ll get references viaprov:wasDerivedFrom from a statement anyway.)
    • To filter for senses, you can useontolex:LexicalSense instead ofwikibase:Sense.
    • To filter for forms, you can useontolex:Form instead ofwikibase:Form.
  2. Data nodes (wdata:Q2) are not stored, all the information like version, revision andpage props is stored in the entity node (wd:Q2) instead. This is done for performance reasons.
  3. For labels, onlyrdfs:label is stored but notschema:name orskos:prefLabel. Since they all have the same data, storing all three is redundant.
  4. Redirects are recorded but currently have no additional semantics implemented.
  5. WDQS nowuses local IRIs (Skolem IRIs) instead of blank nodes to representsomevalue. These can be tested withFILTERwikibase:isSomeValue(?node) rather thanFILTERisBlank(?node)

See alsoSPARQL query examples for how to query the data using WDQS service.

Retrieved from "https://www.mediawiki.org/w/index.php?title=Wikibase/Indexing/RDF_Dump_Format&oldid=7726878"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp