summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Car <nicholas.car@surroundaustralia.com>2020-05-16 21:06:57 +1000
committerNicholas Car <nicholas.car@surroundaustralia.com>2020-05-16 21:06:57 +1000
commit1a589c6ea73b9b167a9bed917783cfe1234b1eab (patch)
tree4a129fc37c1bd2e14c501c6cb484b122660d5061
parent0be6f6039479ce29cf71b11e76be54e186130036 (diff)
parent231bc6d238ff6e4d6eaae9d65a7d96b953136ae4 (diff)
downloadrdflib-1a589c6ea73b9b167a9bed917783cfe1234b1eab.tar.gz
Merge branch 'master' into kill-Py2
# Conflicts: # rdflib/namespace.py
-rw-r--r--rdflib/__init__.py2
-rw-r--r--rdflib/namespace.py85
2 files changed, 49 insertions, 38 deletions
diff --git a/rdflib/__init__.py b/rdflib/__init__.py
index 96244acd..a6c6c39a 100644
--- a/rdflib/__init__.py
+++ b/rdflib/__init__.py
@@ -68,6 +68,7 @@ __all__ = [
"OWL",
"PROF",
"PROV",
+ "QB",
"RDF",
"RDFS",
"SDO",
@@ -173,6 +174,7 @@ from rdflib.namespace import (
OWL,
PROF,
PROV,
+ QB,
RDF,
RDFS,
SDO,
diff --git a/rdflib/namespace.py b/rdflib/namespace.py
index 92016319..00b3c0ff 100644
--- a/rdflib/namespace.py
+++ b/rdflib/namespace.py
@@ -76,17 +76,29 @@ __all__ = [
"Namespace",
"ClosedNamespace",
"NamespaceManager",
- "XMLNS",
+ "CSVW",
+ "DC",
+ "DCAT",
+ "DCTERMS",
+ "DOAP",
+ "FOAF",
+ "ODRL2",
+ "ORG",
+ "OWL",
+ "PROF",
+ "PROV",
+ "QB",
"RDF",
"RDFS",
- "XSD",
- "OWL",
+ "SDO",
+ "SH",
"SKOS",
- "DOAP",
- "FOAF",
- "DC",
- "DCTERMS",
+ "SOSA",
+ "SSN",
+ "TIME",
"VOID",
+ "XMLNS",
+ "XSD",
]
logger = logging.getLogger(__name__)
@@ -267,34 +279,6 @@ class _RDFNamespace(ClosedNamespace):
return super(_RDFNamespace, self).term(name)
-RDF = _RDFNamespace()
-
-
-RDFS = ClosedNamespace(
- uri=URIRef("http://www.w3.org/2000/01/rdf-schema#"),
- terms=[
- "Resource",
- "Class",
- "subClassOf",
- "subPropertyOf",
- "comment",
- "label",
- "domain",
- "range",
- "seeAlso",
- "isDefinedBy",
- "Literal",
- "Container",
- "ContainerMembershipProperty",
- "member",
- "Datatype",
- ],
-)
-
-OWL = Namespace("http://www.w3.org/2002/07/owl#")
-
-XSD = Namespace(_XSD_PFX)
-
CSVW = Namespace("http://www.w3.org/ns/csvw#")
DC = Namespace("http://purl.org/dc/elements/1.1/")
DCAT = Namespace("http://www.w3.org/ns/dcat#")
@@ -356,6 +340,8 @@ FOAF = ClosedNamespace(
)
ODRL2 = Namespace("http://www.w3.org/ns/odrl/2/")
ORG = Namespace("http://www.w3.org/ns/org#")
+OWL = Namespace("http://www.w3.org/2002/07/owl#")
+PROF = Namespace("http://www.w3.org/ns/dx/prof/")
PROV = ClosedNamespace(
uri=URIRef("http://www.w3.org/ns/prov#"),
terms=[
@@ -444,6 +430,30 @@ PROV = ClosedNamespace(
PROF = Namespace("http://www.w3.org/ns/dx/prof/")
SDO = Namespace("https://schema.org/")
SH = Namespace("http://www.w3.org/ns/shacl#")
+QB = Namespace("http://purl.org/linked-data/cube#")
+RDF = _RDFNamespace()
+RDFS = ClosedNamespace(
+ uri=URIRef("http://www.w3.org/2000/01/rdf-schema#"),
+ terms=[
+ "Resource",
+ "Class",
+ "subClassOf",
+ "subPropertyOf",
+ "comment",
+ "label",
+ "domain",
+ "range",
+ "seeAlso",
+ "isDefinedBy",
+ "Literal",
+ "Container",
+ "ContainerMembershipProperty",
+ "member",
+ "Datatype",
+ ],
+)
+SDO = Namespace("https://schema.org/")
+SH = Namespace("http://www.w3.org/ns/shacl#")
SKOS = ClosedNamespace(
uri=URIRef("http://www.w3.org/2004/02/skos/core#"),
terms=[
@@ -486,6 +496,8 @@ SOSA = Namespace("http://www.w3.org/ns/ssn/")
SSN = Namespace("http://www.w3.org/ns/sosa/")
TIME = Namespace("http://www.w3.org/2006/time#")
VOID = Namespace("http://rdfs.org/ns/void#")
+XMLNS = Namespace("http://www.w3.org/XML/1998/namespace")
+XSD = Namespace(_XSD_PFX)
class NamespaceManager(object):
@@ -824,9 +836,6 @@ def is_ncname(name):
return 0
-XMLNS = "http://www.w3.org/XML/1998/namespace"
-
-
def split_uri(uri, split_start=SPLIT_START_CATEGORIES):
if uri.startswith(XMLNS):
return (XMLNS, uri.split(XMLNS)[1])