Skip to content

to_rdf silently ignores invalid IRIs #137

@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

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions