Repository: RDFLib/rdflib

Issue:
RDF namespace does not allow rdf:Seq valid terms
Hi,

According to the [RDFS recommendation](https://www.w3.org/TR/rdf-schema/#ch_collectionvocab), elements of an rdf:Seq can be ordered by using predicates of the form:

`C rdf:_nnn O`

"where `nnn` is the decimal representation of an integer greater than 0 with no leading zeros". However in rdflibish notation these do not work:

```
>>> RDF["_1"]
Exception: term '_1' not in namespace 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
>>> RDF._1
Exception: term '_1' not in namespace 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
```

My current workaround is to mint new URIRefs for these, but I guess a more elegant solution could be provided?

Thanks,
Albert


Comments:

Patch:
diff --git a/docs/intro_to_sparql.rst b/docs/intro_to_sparql.rst
index ef7aab78..72a87c66 100644
--- a/docs/intro_to_sparql.rst
+++ b/docs/intro_to_sparql.rst
@@ -39,7 +39,8 @@ For example...
         ?a foaf:name ?aname .
         ?b foaf:name ?bname .
     }"""
-
+    
+    qres = g.query(knows_query)
     for row in qres:
         print(f"{row.aname} knows {row.bname}")
 
diff --git a/docs/sphinx-requirements.txt b/docs/sphinx-requirements.txt
index 7096a117..f5e39519 100644
--- a/docs/sphinx-requirements.txt
+++ b/docs/sphinx-requirements.txt
@@ -1,3 +1,3 @@
-sphinx==4.1.1
+sphinx==4.1.2
 sphinxcontrib-apidoc
 git+https://github.com/gniezen/n3pygments.git
diff --git a/rdflib/namespace/_RDF.py b/rdflib/namespace/_RDF.py
index 61bc4a58..f79d75a7 100644
--- a/rdflib/namespace/_RDF.py
+++ b/rdflib/namespace/_RDF.py
@@ -16,6 +16,7 @@ class RDF(DefinedNamespace):
     """
 
     _fail = True
+    _underscore_num = True
 
     # http://www.w3.org/1999/02/22-rdf-syntax-ns#List
     nil: URIRef  # The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it.
diff --git a/rdflib/namespace/__init__.py b/rdflib/namespace/__init__.py
index 62a2a946..23f4ec0e 100644
--- a/rdflib/namespace/__init__.py
+++ b/rdflib/namespace/__init__.py
@@ -288,71 +288,6 @@ class ClosedNamespace(Namespace):
         return dir(self)
 
 
-class _RDFNamespace(ClosedNamespace):
-    """
-    Closed namespace for RDF terms
-    """
-
-    def __new__(cls):
-        return super().__new__(
-            cls,
-            "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-            terms=[
-                # Syntax Names
-                "RDF",
-                "Description",
-                "ID",
-                "about",
-                "parseType",
-                "resource",
-                "li",
-                "nodeID",
-                "datatype",
-                # RDF Classes
-                "Seq",
-                "Bag",
-                "Alt",
-                "Statement",
-                "Property",
-                "List",
-                "PlainLiteral",
-                # RDF Properties
-                "subject",
-                "predicate",
-                "object",
-                "type",
-                "value",
-                "first",
-                "rest",
-                # and _n where n is a non-negative integer
-                # RDF Resources
-                "nil",
-                # Added in RDF 1.1
-                "XMLLiteral",
-                "HTML",
-                "langString",
-                # Added in JSON-LD 1.1
-                "JSON",
-                "CompoundLiteral",
-                "language",
-                "direction",
-            ],
-        )
-
-    def term(self, name):
-        # Container membership properties
-        if name.startswith("_"):
-            try:
-                i = int(name[1:])
-            except ValueError:
-                pass
-            else:
-                if i > 0:
-                    return URIRef(f"{self}_{i}")
-
-        return super().term(name)
-
-
 XMLNS = Namespace("http://www.w3.org/XML/1998/namespace")
 
 
diff --git a/rdflib/plugin.py b/rdflib/plugin.py
index 1605b0bb..719c7eaf 100644
--- a/rdflib/plugin.py
+++ b/rdflib/plugin.py
@@ -205,7 +205,7 @@ register("application/n-triples", Parser, "rdflib.plugins.parsers.ntriples", "NT
 register("ntriples", Parser, "rdflib.plugins.parsers.ntriples", "NTParser")
 register("nt", Parser, "rdflib.plugins.parsers.ntriples", "NTParser")
 register("nt11", Parser, "rdflib.plugins.parsers.ntriples", "NTParser")
-register("application/json+ld", Parser, "rdflib.plugins.parsers.jsonld", "JsonLDParser")
+register("application/ld+json", Parser, "rdflib.plugins.parsers.jsonld", "JsonLDParser")
 register("json-ld", Parser, "rdflib.plugins.parsers.jsonld", "JsonLDParser")
 
 


Test patch:
diff --git a/test/test_namespace.py b/test/test_namespace.py
index 23fdb1e2..76f5bbf1 100644
--- a/test/test_namespace.py
+++ b/test/test_namespace.py
@@ -241,4 +241,7 @@ class NamespacePrefixTest(unittest.TestCase):
         )
 
         ref = URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
-        self.assertTrue(ref in RDF, "_RDFNamespace does not include rdf:type")
+        self.assertTrue(ref in RDF, "RDF does not include rdf:type")
+
+        ref = URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#_1")
+        self.assertTrue(ref in RDF, "RDF does not include rdf:_1")