Page MenuHomePhabricator

Add link classification by site type in RDF
Closed, ResolvedPublic


Right now links in RDF are represented like this:

<> a schema:Article ;
    schema:about wd:Q3 ;
    schema:inLanguage "en" ;
    wikibase:badge wd:Q5 .

Which has one glaring omission: it is hard to distinguish between links to sites in the same language, such as English Wikipedia and English Wikisource. It would be nice to have some way to make it easier.


  • schema:isPartOf <>
  • schema:isPartOf wd:Q1234, where wd:Q1234 is an entity for English wikipedia
  • wikibase:wikiType wikibase:Wikipedia
  • wikibase:wikiType wd:Q1234, where wd:Q1234 is an entity for English wikipedia

Other ideas?

Event Timeline

Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript
Smalyshev triaged this task as Medium priority.Feb 20 2016, 12:46 AM

Proposal: add the following two elements to the links:

<> schema:isPartOf <>
<> wikibase:wikiGroup "wikipedia"

Change 276654 had a related patch set uploaded (by Smalyshev):
Add link classification by site type

I'd prefer to attach the group to the site, not the page:

<> schema:isPartOf <>
<> wikibase:wikiGroup "wikipedia"

Also, we should think about whether or is semantically correct. I'm leaning towards the latter.

/wiki/ is an implementation detail, not really a part of what identifies the site, and also not what we see e.g. in in "official website" property.

As for <> wikibase:wikiGroup "wikipedia" I see you point, but then it looks wasteful to repeat the same triple over and over... Maybe we should deduplicate it then?

@Smalyshev Indeed, the idea was to output <> wikibase:wikiGroup "wikipedia" only once, not for every sitelink.

Change 276654 merged by jenkins-bot:
Add link classification by site type