Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce WGS84 DefinedNamespace #1710

Merged
merged 6 commits into from Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions rdflib/namespace/_WGS.py
@@ -0,0 +1,25 @@
from rdflib.namespace import DefinedNamespace, Namespace
from rdflib.term import URIRef


class WGS(DefinedNamespace):
"""
Basic Geo (WGS84 lat/long) Vocabulary

The HTML Specification for the vocabulary can be found
`here <https://www.w3.org/2003/01/geo/>`.
"""

_NS = Namespace("https://www.w3.org/2003/01/geo/wgs84_pos#")

# http://www.w3.org/2000/01/rdf-schema#Class
SpatialThing: URIRef
Point: URIRef

# http://www.w3.org/2002/07/owl#DatatypeProperty
alt: URIRef

lat: URIRef # http://www.w3.org/2003/01/geo/wgs84_pos#lat
lat_long: URIRef
location: URIRef
long: URIRef
3 changes: 3 additions & 0 deletions rdflib/namespace/__init__.py
Expand Up @@ -75,6 +75,7 @@
* TIME
* VANN
* VOID
* WGS
* XSD

.. code-block:: pycon
Expand Down Expand Up @@ -373,6 +374,7 @@ def __init__(self, graph: "Graph"):
self.bind("time", TIME)
self.bind("vann", VANN)
self.bind("void", VOID)
self.bind("wgs", WGS)
self.bind("xsd", XSD)

# Namespace bindings.
Expand Down Expand Up @@ -777,4 +779,5 @@ def get_longest_namespace(trie: Dict[str, Any], value: str) -> Optional[str]:
from rdflib.namespace._TIME import TIME
from rdflib.namespace._VANN import VANN
from rdflib.namespace._VOID import VOID
from rdflib.namespace._WGS import WGS
from rdflib.namespace._XSD import XSD