profile
viewpoint

Ask questionsMultiple owl:sameAs converted to link:uri

I have problems in defining multiple owl:sameAs links: the first one is correctly mantained, while the others are converted in link:uri.

What I expect:

@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix ent: <http://www.wikidata.org/entity/>.
@prefix link: <http://www.w3.org/2007/ont/link#>.

<http://data.doremus.org/artist/6a3d23e2-3264-3fb4-b1f9-c71b50eed635>
    owl:sameAs
       <http://www.wikidata.org/entity/Q2821467>,
        <http://viaf.org/viaf/121568779>,
        <https://musicbrainz.org/artist/abd51f20-f80d-4114-b139-5b71bc4bbce9>.

What I obtain:

@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix ent: <http://www.wikidata.org/entity/>.
@prefix link: <http://www.w3.org/2007/ont/link#>.

<http://data.doremus.org/artist/6a3d23e2-3264-3fb4-b1f9-c71b50eed635>
    owl:sameAs
       ent:Q2821467;
    link:uri
        "http://viaf.org/viaf/121568779",
        "http://www.wikidata.org/entity/Q2821467",
        "https://musicbrainz.org/artist/abd51f20-f80d-4114-b139-5b71bc4bbce9".

My code:

const $rdf = require('rdflib');
const fs = require('fs');

var OWL = $rdf.Namespace("http://www.w3.org/2002/07/owl#");

var store = $rdf.graph();
var artist = $rdf.sym('http://data.doremus.org/artist/6a3d23e2-3264-3fb4-b1f9-c71b50eed635');

store.add(artist, OWL('sameAs'), $rdf.sym(`http://www.wikidata.org/entity/Q2821467`));
store.add(artist, OWL('sameAs'), $rdf.sym(`http://viaf.org/viaf/121568779`));
store.add(artist, OWL('sameAs'), $rdf.sym(`https://musicbrainz.org/artist/abd51f20-f80d-4114-b139-5b71bc4bbce9`));

$rdf.serialize(undefined, store, 'http://example.org', 'text/turtle', (err, str) => {
  if (err) return console.error(err);

  fs.writeFile('../data/artists.ttl', str, 'utf8');
});
linkeddata/rdflib.js

Answer questions timbl

This should be fixed by https://github.com/linkeddata/rdflib.js/pull/492

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List