Skip to content

Commit

Permalink
fix: change the prefix for https://schema.org/ back to schema`
Browse files Browse the repository at this point in the history
The default prefix for `https://schema.org/` registered with
`rdflib.namespace.NamespaceManager` was inadvertently changed to `sdo` in 6.2.0,
this however constitutes a breaking change, as code that was using the `schema`
prefix would no longer have the same behavior. This change changes the prefix
back to `schema`.
  • Loading branch information
aucampia committed Mar 25, 2023
1 parent 832e693 commit a65bfeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rdflib/namespace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ class NamespaceManager(object):
* rdflib:
* binds all the namespaces shipped with RDFLib as DefinedNamespace instances
* all the core namespaces and all the following: brick, csvw, dc, dcat
* dcmitype, dcterms, dcam, doap, foaf, geo, odrl, org, prof, prov, qb, sdo
* sh, skos, sosa, ssn, time, vann, void, wgs
* dcmitype, dcterms, dcam, doap, foaf, geo, odrl, org, prof, prov, qb, schema
* sh, skos, sosa, ssn, time, vann, void
* see the NAMESPACE_PREFIXES_RDFLIB object for the up-to-date list
* none:
* binds no namespaces to prefixes
Expand Down Expand Up @@ -906,7 +906,7 @@ def get_longest_namespace(trie: Dict[str, Any], value: str) -> Optional[str]:
"prof": PROF,
"prov": PROV,
"qb": QB,
"sdo": SDO,
"schema": SDO,
"sh": SH,
"skos": SKOS,
"sosa": SOSA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@


sys.path.append(str(Path(__file__).parent.parent.absolute()))
from rdflib import Graph
from rdflib.namespace import (
from rdflib import Graph # noqa: E402
from rdflib.namespace import ( # noqa: E402
_NAMESPACE_PREFIXES_CORE,
_NAMESPACE_PREFIXES_RDFLIB,
OWL,
Expand Down Expand Up @@ -196,7 +196,7 @@ def test_nman_bind_namespaces(
"qb": "http://purl.org/linked-data/cube#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"sdo": "https://schema.org/",
"schema": "https://schema.org/",
"sh": "http://www.w3.org/ns/shacl#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"sosa": "http://www.w3.org/ns/sosa/",
Expand Down

0 comments on commit a65bfeb

Please sign in to comment.