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.2.tar.gz
(17.5 kB
view details)
File details
Details for the file ontopia-py-0.0.2.tar.gz.
File metadata
- Download URL: ontopia-py-0.0.2.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
523067b13c751e1e746f030f13f0cff9bf67253e6d455cad103a84bdc74acef9
|
|
| MD5 |
3b1fd491c7e56cc938115c158591b46e
|
|
| BLAKE2b-256 |
21d7e16e1f9d838a2fc5e2d26208f37a74cf98c3ab8d92eaf84eb6dae1cf4938
|