Skip to content

Should handle less-than and other disallowed characters #47

@alexkreidler

Description

@alexkreidler

I have an entry in a JSON-LD file like this:

        {
          "@id": "ex:BOE/code/INSTRUMENTS/LDA>1Y",
          "@type": "skos:Concept",
          "skos:prefLabel": "Medium and long term deposits",
          "skos:notation": "LDA>1Y"
        },

It gets converted by this library into:

<https://example.com/BOE/code/INSTRUMENTS/LDA>1Y> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> .
<https://example.com/BOE/code/INSTRUMENTS/LDA>1Y> <http://www.w3.org/2004/02/skos/core#hasTopConcept> <https://example.com/BOE/code/INSTRUMENTS> .
<https://example.com/BOE/code/INSTRUMENTS/LDA>1Y> <http://www.w3.org/2004/02/skos/core#notation> "LDA>1Y" .
<https://example.com/BOE/code/INSTRUMENTS/LDA>1Y> <http://www.w3.org/2004/02/skos/core#prefLabel> "Medium and long term deposits" .

As you can see, the LDA>1Y> section is problematic because N-Triples parsers fail at that position. They view the IRI as already being closed.

I'm not sure if the JSON-LD spec has anything to say about this, i.e. whether the > should be URL encoded, or if the serializer should just return an error.

But the library should do one of those two: either serialize it properly or throw an error, rather than silently emit invalid N-Triples.

Let me know if I can provide more info. Thanks for this awesome library!

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