RDFLib / rdflib-jsonld

JSON-LD parser and serializer plugins for RDFLib
Other
280 stars 71 forks source link

Graph.parse converts `https` to `http` #59

Open robinsonkwame opened 5 years ago

robinsonkwame commented 5 years ago

Given,

from rdflib import Graph                                                                                                                   
obj=\
'''
{
    "@context": "https://schema.org",
    "@type": "Movie",
    "name": "Jason Bourne"
}
'''
g = Graph().parse(data=obj, format='json-ld')                                                                                              
list(g.namespaces())

Shouldn't I expect to see ('', rdflib.term.URIRef('https://schema.org/')), and not ('', rdflib.term.URIRef('http://schema.org/')), in the namespace?

Why does https get conflated with http? This is prevents object matching against a specification that uses https://schema.org as the default namespace.

robinsonkwame commented 5 years ago

Upon further reading, this is apropos: https://github.com/w3c/web-annotation/issues/193

Essentially, the namespace is set by the vocab and https://schema.org has vocab set to http://schema.org, leading to a perception of https being conflated with http, with objects having a http://schema.org namespace instead of as expected.