Skip to content

Namespaces

app.namespaces

Shared RDF namespaces, entity classes, separators, and SPARQL prefixes.

COMPASS = Namespace('http://example.org/ocean-org/ontology#') module-attribute

Compass ontology namespace (entity classes and properties).

GEO = Namespace('http://www.w3.org/2003/01/geo/wgs84_pos#') module-attribute

W3C WGS84 geo namespace (lat / long).

SCHEMA = Namespace('https://schema.org/') module-attribute

schema.org namespace (url, image, ...).

PIN_CLASSES = ('InternationalForum', 'Network', 'PartnerOrganization', 'HostOrganization') module-attribute

Entity classes the map draws.

ALWAYS_ON_CLASSES = ('HostOrganization',) module-attribute

Entity classes that keep their pin whatever the filters say.

The backend never counts them in the facets; the frontend adds them to every count.

FILTERABLE_PIN_CLASSES = tuple(c for c in PIN_CLASSES if c not in ALWAYS_ON_CLASSES) module-attribute

The classes the entityType dimension offers.

ENTITY_TYPE_ID = 'entityType' module-attribute

Id of the synthetic filter dimension over rdf:type; it has no property shape.

ITEM_SEP = ';;' module-attribute

Separator between multi-valued items in GROUP_CONCAT output.

FIELD_SEP = '|' module-attribute

Separator between fields within a single GROUP_CONCAT item (IRI|label).

PREFIX_MAP = {str(COMPASS): 'compass:', str(GEO): 'geo:', str(SCHEMA): 'schema:'} module-attribute

Full namespace URI -> SPARQL prefix used by to_prefixed.

SPARQL_PREFIXES = '\n PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>\n PREFIX compass: <http://example.org/ocean-org/ontology#>\n PREFIX schema: <https://schema.org/>\n PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n ' module-attribute

PREFIX block prepended to every generated SPARQL query.

local_name(iri)

Return the part of iri after its last # or /.

Parameters:

Name Type Description Default
iri str

Absolute IRI string.

required

Returns:

Type Description
str

The fragment or final path segment.

Source code in src/backend/app/namespaces.py
60
61
62
63
64
65
66
67
68
69
def local_name(iri: str) -> str:
    """Return the part of *iri* after its last ``#`` or ``/``.

    Args:
        iri: Absolute IRI string.

    Returns:
        The fragment or final path segment.
    """
    return iri.rsplit("#", maxsplit=1)[-1].rsplit("/", maxsplit=1)[-1]