Page MenuHomePhabricator

Add link classification by site type in RDF
Closed, ResolvedPublic

Description

Right now links in RDF are represented like this:

<http://en.wikipedia.org/wiki/Duck> 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.

Options:

  • schema:isPartOf <http://en.wikipedia.org/>
  • 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:

<http://en.wikipedia.org/wiki/Duck> schema:isPartOf <http://en.wikipedia.org/>
<http://en.wikipedia.org/wiki/Duck> wikibase:wikiGroup "wikipedia"

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

https://gerrit.wikimedia.org/r/276654

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

<http://en.wikipedia.org/wiki/Duck> schema:isPartOf <http://en.wikipedia.org/>
<http://en.wikipedia.org/> wikibase:wikiGroup "wikipedia"

Also, we should think about whether http://en.wikipedia.org/ or http://en.wikipedia.org/wiki/ 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 https://www.wikidata.org/wiki/Q328 in "official website" property.

As for <http://en.wikipedia.org/> 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 <http://en.wikipedia.org/> wikibase:wikiGroup "wikipedia" only once, not for every sitelink.

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

https://gerrit.wikimedia.org/r/276654