Skip to main content

A python package to create OntoPiA RDFs.

Project description

ontopia-py

Maintenance PyPI version PyPI pyversions PyPI status

This python package helps in create and implements an OntoPiA RDF.

How it works

For example, to create a street toponym in the ANNCSU dataset:

from rdflib import XSD, Graph, Literal, Namespace

from ontopia_py import ConceptScheme, createGraph
from ontopia_py.clv import StreetToponym

# Set namespace for data
ANNCSU: Namespace = Namespace("https://w3id.org/sona/data/ANNCSU/")

# Create the graph and bind the namespace
g = createGraph()
g.bind("anncsu", ANNCSU)

# Create the concept scheme
ANNCSU_DATA: ConceptScheme = ConceptScheme(ANNCSU)
ANNCSU_DATA.label = [
    Literal("Anagrafe nazionale numeri civici e strade urbane", lang="it"),
    Literal("Civic Addressing and Street Naming", lang="en")
]

# Add to graph
ANNCSU_DATA.addToGraph(g)

# Create the street toponym
streetToponym: StreetToponym = StreetToponym(
  id="street-1",
  baseUri=ANNCSU,
  dataset=ANNCSU_DATA,
  titles=[Literal("Via Roma", datatype=XSD.string)]
)
streetToponym.toponymQualifier = "Via"
streetToponym.officialStreetName = "Roma"

# Add to graph
streetToponym.addToGraph(g)

Ontologies implemented

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ontopia-py-0.0.6.tar.gz (26.7 kB view details)

Uploaded Source

File details

Details for the file ontopia-py-0.0.6.tar.gz.

File metadata

  • Download URL: ontopia-py-0.0.6.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for ontopia-py-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d899b797c7f5ef394444bdf1837d542117251b38beb525ca9860e0863fc860dc
MD5 707423b18b95ff417a195c6a553b3b06
BLAKE2b-256 2cccb2db475155b1c06b36713a00c67569739a42cf911698b3d2e46bec21f792

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page