Fraunhofer-FIT-DSAI / drk-information-model

Datenraum Kultur (DRK) Information Model
3 stars 0 forks source link

DRK IM domain-agnostic layer: Find controlled vocabularies for representing domain-agnostic ENUMs #7

Open rohitadeshmukh13 opened 1 month ago

rohitadeshmukh13 commented 1 month ago

Description

Example

@prefix ex: <http://example.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix loclang: <http://id.loc.gov/vocabulary/iso639-2/> .
@prefix gndgeo: <https://d-nb.info/standards/vocab/gnd/geographic-area-code#> .

ex:Movie1 a ex:Movie ;
    dcterms:title "Movie1: subtitle1"@en ;
    ###
    # Languages:
    # Library of Congress's controlled vocabulary for languages based on ISO 639-2: https://id.loc.gov/vocabulary/iso639-2.html 
    # RDF N-Triples representation: https://id.loc.gov/vocabulary/iso639-2.nt
    ###
    ex:language loclang:eng ;
    ###
    # Countries (Geographic Areas):
    # GND Geographic Area Codes: https://d-nb.info/standards/vocab/gnd/geographic-area-code.html
    # RDF TTL representation: https://d-nb.info/standards/vocab/gnd/geographic-area-code.ttl
    ###
    ex:releasedIn gndgeo:XA-DE .

RESULTS: Identified controlled vocabularies for representing domain-agnostic ENUMs

rohitadeshmukh13 commented 1 month ago

As presented in the DRK IM UC3 meeting on 17 July 2024, the following vocabularies have already been identified to represent Languages and Countries / Geographic Areas. Their use needs to be reviewed and approved or alternatives need to be suggested.

Languages:

Countries (Geographic Areas):

rohitadeshmukh13 commented 1 month ago

For currencies, Schema.org recommends using the ISO 4217 currency format

Daham-Mustaf commented 1 month ago

Language Enumeration

For the Language Enumeration, we can use the following ontology:


# This ontology defines a Language enumeration for our system.
# It uses ISO 639-1 language codes and currently supports English and German.
# The ontology is extensible and includes instructions for adding new languages.

:Language a owl:Class ;
    owl:oneOf ( :en :de ) ;
    rdfs:comment "Enumeration of supported languages in the system using ISO 639-1 language codes." ;
    rdfs:seeAlso <https://www.loc.gov/standards/iso639-2/php/code_list.php> ;
    dc:source "ISO 639-1" ;
    skos:prefLabel "Language"@en, "Sprache"@de ;
    skos:note """
    This enumeration currently includes only English (en) and German (de).
    When extending the system to support additional languages:
    1. Add new language instances using their ISO 639-1 two-letter codes.
    2. Update the owl:oneOf list to include the new language instances.
    3. Ensure that all application logic and user interfaces support the newly added languages.
    4. Consider implementing a more flexible language handling system if the number of supported languages grows significantly.

    Example of adding French:
    :fr a :Language ;
        skos:prefLabel "French"@en, "Français"@fr ;
        skos:notation "fr" .

    Then update the oneOf list:
    owl:oneOf ( :en :de :fr )
    """ .

:en a :Language ;
    skos:prefLabel "English"@en, "Englisch"@de ;
    skos:notation "en" .

:de a :Language ;
    skos:prefLabel "German"@en, "Deutsch"@de ;
    skos:notation "de" .
Daham-Mustaf commented 1 month ago

Solution: Geographic Location Enumeration for UC3

This ontology uses the Getty Thesaurus of Geographic Names (TGN) for standardized place identification. TGN is a structured vocabulary that includes names and other information about places. It's used here to provide authoritative identifiers for geographic locations.

To implement a geographical location enumeration in our ontology for UC3, we'll follow these steps:

  1. Create a new file geographic-enumeration.ttl
  2. Define required countries in this file
  3. Import the enumeration into our main ontology

Implementation Details

1. Create geographic-enumeration.ttl

Create a new file named geographic-enumeration.ttl in the ontology directory of our repository.

2. Define countries in geographic-enumeration.ttl

Add the following content to geographic-enumeration.ttl:


@prefix : <http://example.org/ontology#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix tgn: <http://vocab.getty.edu/tgn/> .

:GeographicLocation a owl:Class ;
    rdfs:label "Geographic Location"@en ;
    rdfs:comment "An enumeration of geographic locations used in our system." ;
    rdfs:seeAlso <http://vocab.getty.edu/tgn/> ;
    owl:oneOf (
        :UnitedStates
        :Germany
        :France
        :UnitedKingdom
        :Japan
        # Add other countries as needed for UC3
    ) .

:UnitedStates a :GeographicLocation ;
    rdfs:label "United States"@en ;
    skos:exactMatch tgn:7012149 .

:Germany a :GeographicLocation ;
    rdfs:label "Germany"@en ;
    skos:exactMatch tgn:7000084 .

:France a :GeographicLocation ;
    rdfs:label "France"@en ;
    skos:exactMatch tgn:1000070 .

:UnitedKingdom a :GeographicLocation ;
    rdfs:label "United Kingdom"@en ;
    skos:exactMatch tgn:7008591 .

:Japan a :GeographicLocation ;
    rdfs:label "Japan"@en ;
    skos:exactMatch tgn:1000120 .

# Add other countries as needed

### 3. Import into main ontology

To import the geographic enumeration into the main ontology file, add the following import statement at the beginning of your main ontology file (e.g., `main-ontology.ttl`):

```turtle
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix : <http://example.org/ontology#> .

<http://example.org/ontology>
    a owl:Ontology ;
    owl:imports <http://example.org/ontology/geographic-enumeration.ttl> .

# Rest of your main ontology content follows...
## Usage Examples

Here are some examples of how to use the geographic locations in your ontology, focused on the cultural domain of theater:

1. Specifying the location of a theater:

```turtle
:GlobeTheatre a :Theater ;
    :locatedIn :UnitedKingdom ;
    rdfs:label "Globe Theatre" .

```turtle
:WorldTheaterFestival2024 a :TheaterFestival ;
    :hasParticipants [
        a :FestivalParticipant ;
        :theater :ComediesFrancaise ;
        :originCountry :France
    ], [
        a :FestivalParticipant ;
        :theater :BurgTheater ;
        :originCountry :Germany
    ] ;
    :hostedIn :UnitedStates ;
    rdfs:label "World Theater Festival 2024" .```
Daham-Mustaf commented 1 month ago

Currency Controlled Vocabulary for Ontology

Overview

This document provides a comprehensive guide for defining a controlled vocabulary for currency, importing it into your main ontology, and using it within your ontology data.

1. Define the Currency Enumeration

Create a file named currency-enumeration.ttl with the following content:

@prefix : <http://example.org/ontology#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:Currency a owl:Class ;
    rdfs:label "Currency"@en ;
    rdfs:comment "An enumeration of currencies used in the system." ;
    rdfs:seeAlso <https://www.iso.org/iso-4217-currency-codes.html> ;
    owl:oneOf (
        :USD
        :EUR
        :GBP
        :JPY
        :CHF
        # Add other currencies as needed
    ) .

:USD a :Currency ;
    rdfs:label "US Dollar"@en ;
    :currencyCode "USD" ;
    :numericCode "840" ;
    :symbol "$" .

:EUR a :Currency ;
    rdfs:label "Euro"@en ;
    :currencyCode "EUR" ;
    :numericCode "978" ;
    :symbol "€" .

:GBP a :Currency ;
    rdfs:label "British Pound"@en ;
    :currencyCode "GBP" ;
    :numericCode "826" ;
    :symbol "£" .

:JPY a :Currency ;
    rdfs:label "Japanese Yen"@en ;
    :currencyCode "JPY" ;
    :numericCode "392" ;
    :symbol "¥" .

:CHF a :Currency ;
    rdfs:label "Swiss Franc"@en ;
    :currencyCode "CHF" ;
    :numericCode "756" ;
    :symbol "CHF" .

:currencyCode a owl:DatatypeProperty ;
    rdfs:label "currency code"@en ;
    rdfs:comment "The ISO 4217 three-letter code for the currency." ;
    rdfs:domain :Currency ;
    rdfs:range xsd:string .

:numericCode a owl:DatatypeProperty ;
    rdfs:label "numeric code"@en ;
    rdfs:comment "The ISO 4217 numeric code for the currency." ;
    rdfs:domain :Currency ;
    rdfs:range xsd:string .

:symbol a owl:DatatypeProperty ;
    rdfs:label "symbol"@en ;
    rdfs:comment "The symbol used to represent the currency." ;
    rdfs:domain :Currency ;
    rdfs:range xsd:string .

2. Import the Enumeration into the Main Ontology

To integrate the currency enumeration into your main ontology file (e.g., main-ontology.ttl), add the following import statement at the beginning of the file:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix : <http://example.org/ontology#> .

<http://example.org/ontology>
    a owl:Ontology ;
    owl:imports <http://example.org/ontology/currency-enumeration.ttl> .

# Rest of your main ontology content follows...

Example 1: Regular ticket price for a performance at Staatstheater Augsburg


:AugsburgTheaterTicket a :TheaterTicket ;
    :eventName "Hamlet" ;
    :venue :StaatstheaterAugsburg ;
    :price [
        a :MonetaryValue ;
        :amount "30.00"^^xsd:decimal ;
        :currency :EUR
    ] ;
    :performanceDate "2024-05-15"^^xsd:date .