Skip to content

to_rdf silently ignores invalid IRIs #137

Open
@aucampia

Description

@aucampia

When I run to_rdf on an object with an invalid @id:

import pyld.jsonld as jsonld
result = jsonld.to_rdf({"@id": "http://example.com/some id", "@type": "http://example.com/some_type"})

The the value of result will be

{'@default': []}

In contrast, if I fix the @id to be a valid URI

import pyld.jsonld as jsonld
result = jsonld.to_rdf({"@id": "http://example.com/some_id", "@type": "http://example.com/some_type"})

The the value of result will be

{'@default': [{'subject': {'type': 'IRI', 'value': 'http://example.com/some_id'}, 'predicate': {'type': 'IRI', 'value': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'}, 'object': {'type': 'IRI', 'value': 'http://example.com/some_type'}}]}

I expect that running to_rdf on JSON-LD with invalid IRIs error out instead of silently ignoring the invalid triples.

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