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

Uploaded Source

File details

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

File metadata

  • Download URL: ontopia-py-0.0.3.tar.gz
  • Upload date:
  • Size: 21.3 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.3.tar.gz
Algorithm Hash digest
SHA256 16d97dae97464d9a25b07ee105e77f1735501307206cd20f0bb6553fbe55631f
MD5 88c3b22a3153362a62b214b62d835d14
BLAKE2b-256 04c2e2da40446a729743046cef124497c13a4a01fc890eecd81657583ab52c13

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