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.1.2.tar.gz (58.9 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: ontopia-py-0.1.2.tar.gz
  • Upload date:
  • Size: 58.9 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.1.2.tar.gz
Algorithm Hash digest
SHA256 13398dbb1ad449b90e29230ac3260842ed741c553ac2f596660618bcb525acb4
MD5 6c57be45507d5de65de72c8bc4b8febe
BLAKE2b-256 7f74b8e315a5944db70040a6b254d0e9eff255c1b63b40f1bb5328c13c151e28

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