protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
1.01k stars 231 forks source link

Error importing JSON-LD file #1190

Open cristianolongoodhl opened 8 months ago

cristianolongoodhl commented 8 months ago

I created a file as-audience-examples.jsonld with the following content

{
    "@context":{
        "@base": "http://www.opendatahacklab.org/as-audience-examples#",
        "asaudience": "http://www.opendatahacklab.org/as-audience#"
    },
    "@id": "Alice",
    "@type": "asaudience:Person"
}

With Protege 5.6.3, when I attempt to load this file I got the following error:

ERROR 12:50:03 An error occurred whilst loading the ontology at file:/home/cristiano/papers/AS_audience/as-audience-examples.jsonld. Cause: Not a valid (absolute) IRI: @context

See also #278

cristianolongoodhl commented 8 months ago

Instead, when the file is an array of objects, as in the following example, all works good.

[
    {
        "@context":{
            "@base": "http://www.opendatahacklab.org/as-audience-examples#",
            "asaudience": "http://www.opendatahacklab.org/as-audience#"
        },
        "@id": "Alice",
        "@type": "asaudience:Person"
    }
]