A python package to create OntoPiA RDFs.
Project description
ontopia-py
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
- https://w3id.org/italia/onto/ACCO
- https://w3id.org/italia/onto/AccessCondition
- https://w3id.org/italia/onto/AtlasOfPaths
- https://w3id.org/italia/onto/CLV
- https://w3id.org/italia/onto/COV
- https://w3id.org/italia/onto/CPEV
- https://w3id.org/italia/onto/CPSV
- https://w3id.org/italia/onto/CPV
- https://w3id.org/italia/onto/CulturalHeritage
- https://w3id.org/italia/onto/HER
- https://w3id.org/italia/onto/Indicator
- https://w3id.org/italia/onto/IoT
- https://w3id.org/italia/onto/Language
- https://w3id.org/italia/onto/MU
- https://w3id.org/italia/onto/PARK
- https://w3id.org/italia/onto/POI
- https://w3id.org/italia/onto/POT
- https://w3id.org/italia/onto/Project
- https://w3id.org/italia/onto/PublicContract
- https://w3id.org/italia/onto/RO
- https://w3id.org/italia/onto/Route
- https://w3id.org/italia/onto/SM
- https://w3id.org/italia/onto/TI
- https://w3id.org/italia/onto/Transparency
- https://w3id.org/italia/onto/l0
Project details
Release history Release notifications | RSS feed
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.8.tar.gz
(29.6 kB
view details)
File details
Details for the file ontopia-py-0.0.8.tar.gz.
File metadata
- Download URL: ontopia-py-0.0.8.tar.gz
- Upload date:
- Size: 29.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
994aa8d07a3e7f7bcbd7d3f7164e3590202da9a1c052d1ebfb54af31b767542d
|
|
| MD5 |
5c1e68a6c18441b3b3c3a82649f6dc5e
|
|
| BLAKE2b-256 |
0fc19c770769c4fb28e426571cc47c19549a75e118146a231f6da592edd12688
|