Skip to content

Base Schema with fragment / hash in parsed turtle files leads to incorrect IRI resolution for some parsers #47

@Lenostatos

Description

@Lenostatos

Hello,

I tried to parse the turtle of your RDF Schema ontology file at https://databus.dbpedia.org/ontologies/w3.org/2000--01--rdf-schema/2020.06.10-215336/2000--01--rdf-schema_type=parsed.ttl with a library that uses the N3.js parser.

There, I ran into a problem with the base IRI resolution. I opened an issue with the maintainers of that library, and it seems that there might be an error in the RDF Schema turtle file: rdfjs-base/parser-n3#15

The problem is in the beginning of the turtle code:

@base <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <../../1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <> .
@prefix owl: <../../2002/07/owl#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .

<>
    dc:title "The RDF Schema vocabulary (RDFS)" ;
    a owl:Ontology ;
    rdfs:seeAlso <rdf-schema-more> .

rdfs:Class
    a rdfs:Class ;
    rdfs:comment "The class of classes." ;
    rdfs:isDefinedBy <> ;
    rdfs:label "Class" ;
    rdfs:subClassOf rdfs:Resource .

The hash symbol (#) at the end of the base IRI is apparently stripped by the parser (?) and the resulting triples then contain invalid IRIs:
334765001-5b74cd02-0fc9-4d36-89e8-d6b70e738fef

Unfortunately, I don't have time right now to look too deeply into whether your turtle or the N3.js implementation is correct but I at least wanted to let you know about the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions