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

Uploaded Source

File details

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

File metadata

  • Download URL: ontopia-py-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 f76e96f2a533c42813f9181c42f555643f585148d40096bc583dbf7b8e1fd59c
MD5 9b8f1e23526a70b5185d80f1d6b8178e
BLAKE2b-256 7011dca818aceda4b18dcdfea80dd3cb8c99354a3f6c5579bbfdf00e3c3555e0

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