Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ontology-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Ontology Quality Checks

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
clause9-checks:
runs-on: ubuntu-latest

steps:
- name: Checkout FSL
uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install rdflib pyshacl

- name: Run Clause 9 checks on FSL
run: |
python saref-experiment/run_checks.py \
--ttl ontologies/fsl.ttl \
--extra-ttl ontologies/ \
--label FSL
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
local-experiments/

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A test license file
1 change: 1 addition & 0 deletions documentation/abstract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A test abstract fiile
1 change: 1 addition & 0 deletions documentation/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A test description file
12 changes: 12 additions & 0 deletions examples/python-example.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@prefix fsl: <http://www.softlang.org/ontologies/fsl#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dctype: <http://purl.org/dc/dcmitype/> .

<http://www.softlang.org/ontologies/fsl/examples/python>
a dctype:Dataset ;
dcterms:title "Python Language Example"@en ;
dcterms:description "An example showing how Python is described in FSL"@en .
67 changes: 67 additions & 0 deletions ontologies/pe.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix tbox: <http://www.softlang.org/ontologies/tbox#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://www.softlang.org/ontologies/pe> a owl:Ontology ;
tbox:commentingPolicy "See http://www.softlang.org/ontologies/tbox -- the same policy applies here."@en ;
Expand Down Expand Up @@ -682,6 +684,9 @@ Paradigm-based subclassing of programming languages is not used; paradigms are r
ce:SE,
ce:SLE ;
tbox:hasSpace ce:Programware ;
tbox:hasVersion :Python_2_7,
:Python_3_6,
:Python_3_12 ;
rdfs:comment "multi-paradigm programming language with dynamic typing and strong support for scripting, data processing, and general-purpose programming"@en ;
foaf:isPrimaryTopicOf <https://dbpedia.org/resource/Python_(programming_language)> ;
foaf:page <https://en.wikipedia.org/wiki/Python_(programming_language)> .
Expand Down Expand Up @@ -835,3 +840,65 @@ Paradigm-based subclassing of programming languages is not used; paradigms are r
rdfs:comment "family of Microsoft programming languages and environments"@en ;
foaf:isPrimaryTopicOf <https://dbpedia.org/resource/Visual_Basic> ;
foaf:page <https://en.wikipedia.org/wiki/Visual_Basic> .

# Python version history — SAREF time-series pattern PoC

:Python_2_7 a :ProgrammingLanguage,
tbox:LanguageEntity,
tbox:LanguageVersion,
owl:NamedIndividual ;
rdfs:label "Python 2.7"@en ;
tbox:versionOf :Python ;
tbox:versionTag "2.7" ;
tbox:releaseDate :Python_2_7_release ;
tbox:hasSuccessor :Python_3_6 ;
tbox:hasArea ce:PLT,
ce:SE,
ce:SLE ;
tbox:hasSpace ce:Programware ;
rdfs:comment "Final major release series of the Python 2 line; reached end-of-life on 2020-01-01."@en ;
foaf:page <https://en.wikipedia.org/wiki/History_of_Python> .

:Python_3_6 a :ProgrammingLanguage,
tbox:LanguageEntity,
tbox:LanguageVersion,
owl:NamedIndividual ;
rdfs:label "Python 3.6"@en ;
tbox:versionOf :Python ;
tbox:versionTag "3.6" ;
tbox:releaseDate :Python_3_6_release ;
tbox:hasPredecessor :Python_2_7 ;
tbox:hasSuccessor :Python_3_12 ;
tbox:hasArea ce:PLT,
ce:SE,
ce:SLE ;
tbox:hasSpace ce:Programware ;
rdfs:comment "Python 3.6 introduced f-strings, type variable tuples, and the secrets module."@en ;
foaf:page <https://en.wikipedia.org/wiki/History_of_Python> .

:Python_3_12 a :ProgrammingLanguage,
tbox:LanguageEntity,
tbox:LanguageVersion,
owl:NamedIndividual ;
rdfs:label "Python 3.12"@en ;
tbox:versionOf :Python ;
tbox:versionTag "3.12" ;
tbox:releaseDate :Python_3_12_release ;
tbox:hasPredecessor :Python_3_6 ;
tbox:hasArea ce:PLT,
ce:SE,
ce:SLE ;
tbox:hasSpace ce:Programware ;
rdfs:comment "Python 3.12 is a current active release with improved error messages, performance improvements, and new type system features."@en ;
foaf:page <https://en.wikipedia.org/wiki/History_of_Python> .

# OWL-Time Instant individuals for Python version releases

:Python_2_7_release a time:Instant ;
time:inXSDDate "2010-07-03"^^xsd:date .

:Python_3_6_release a time:Instant ;
time:inXSDDate "2016-12-23"^^xsd:date .

:Python_3_12_release a time:Instant ;
time:inXSDDate "2023-10-02"^^xsd:date .
77 changes: 76 additions & 1 deletion ontologies/tbox.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://www.softlang.org/ontologies/tbox> a owl:Ontology ;
:commentingPolicy "All rdfs:comments must start in upper case."@en ;
:formattingPolicy "TTL syntax is to be used so that triples are grouped by shared subject. Default namespace (\":\") instead of explicit prefixes should be used, whenever possible. The required order in ontology files is: prefix declarations first, followed by the ontology header, then classes ordered by class name, then properties ordered by property name, and finally all remaining assertions ordered by subject name. Any serialization of the ontology should obey this formatting policy."@en ;
:linkingPolicy "All important classes and individuals should link to Wikipedia. Use foaf:isPrimaryTopicOf where possible. Use foaf:page otherwise. Link to https://en.wikipedia.org/wiki/N/A to express that no useful page could be determined."@en ;
:metamodelingPolicy "Punning/metamodeling is used systematically. Every class that is a subclass of an Entity subclass should also be explicitly typed as that Entity subclass. Every individual whose asserted type derives from an Entity subclass should also be explicitly typed as that Entity subclass. Example: le:QueryLanguage a tbox:LanguageEntity . Example: le:SQL a tbox:LanguageEntity . This expectation should be maintained as the ontology evolves."@en ;
rdfs:comment "Shared TBox of the FSL ontology"@en .
rdfs:comment "Shared TBox of the FSL ontology"@en ;
owl:imports <http://www.w3.org/2006/time> .

:ArtifactEntity rdfs:subClassOf :Entity ;
rdfs:label "Artifact entity"@en ;
Expand Down Expand Up @@ -661,3 +663,76 @@
rdfs:range :LanguageSupportKind ;
rdfs:comment "Relates a reified assertion about language concepts with the type of support"@en ;
foaf:page <https://en.wikipedia.org/wiki/Category:Programming_language_concepts> .

# Language version history — SAREF time-series pattern transposed to FSL

:LanguageVersion a :LanguageEntity ;
rdfs:label "Language version"@en ;
rdfs:comment "A specific released version of a software language, positioned in a temporal version sequence. Inspired by the SAREF time-series pattern (ETSI TS 103 673)."@en ;
rdfs:subClassOf :SoftwareLanguage ;
foaf:page <https://en.wikipedia.org/wiki/Software_versioning> .

:ToolVersion a :ToolEntity ;
rdfs:label "Tool version"@en ;
rdfs:comment "A specific released version of a software tool, positioned in a temporal version sequence. Parallel to LanguageVersion for the tool hierarchy."@en ;
rdfs:subClassOf :SoftwareTool ;
foaf:page <https://en.wikipedia.org/wiki/Software_versioning> .

:hasPredecessor a owl:AsymmetricProperty,
owl:IrreflexiveProperty,
owl:ObjectProperty,
:PropertyEntity ;
rdfs:label "has predecessor"@en ;
rdfs:comment "Relates a language or tool version to its immediately preceding released version in the version sequence."@en ;
rdfs:domain [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
rdfs:range [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
owl:inverseOf :hasSuccessor ;
foaf:page <https://en.wikipedia.org/wiki/Software_versioning> .

:hasSuccessor a owl:AsymmetricProperty,
owl:IrreflexiveProperty,
owl:ObjectProperty,
:PropertyEntity ;
rdfs:label "has successor"@en ;
rdfs:comment "Relates a language or tool version to its immediately following released version in the version sequence."@en ;
rdfs:domain [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
rdfs:range [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
owl:inverseOf :hasPredecessor ;
foaf:page <https://en.wikipedia.org/wiki/Software_versioning> .

:hasVersion a owl:ObjectProperty,
:PropertyEntity ;
rdfs:label "has version"@en ;
rdfs:comment "Relates a software language or tool to one of its released versions."@en ;
rdfs:domain [ a owl:Class ; owl:unionOf ( :SoftwareLanguage :SoftwareTool ) ] ;
rdfs:range [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
owl:inverseOf :versionOf ;
foaf:page <https://en.wikipedia.org/wiki/Software_versioning> .

:releaseDate a owl:ObjectProperty,
:PropertyEntity ;
rdfs:label "release date"@en ;
rdfs:comment "Relates a language or tool version to a time:Instant representing its official release. Reuses OWL-Time following the same pattern as SAREF Core."@en ;
rdfs:domain [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
rdfs:range time:Instant ;
foaf:page <https://en.wikipedia.org/wiki/Software_release_life_cycle> .

:versionOf a owl:ObjectProperty,
:PropertyEntity ;
rdfs:label "version of"@en ;
rdfs:comment "Relates a language or tool version to the entity of which it is a version."@en ;
rdfs:domain [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
rdfs:range [ a owl:Class ; owl:unionOf ( :SoftwareLanguage :SoftwareTool ) ] ;
owl:inverseOf :hasVersion ;
foaf:page <https://en.wikipedia.org/wiki/Software_versioning> .

:versionTag a owl:DatatypeProperty,
:PropertyEntity ;
rdfs:label "version tag"@en ;
rdfs:comment "The official version identifier string for a language or tool release (e.g., '3.12.0')."@en ;
rdfs:domain [ a owl:Class ; owl:unionOf ( :LanguageVersion :ToolVersion ) ] ;
rdfs:range xsd:string ;
foaf:page <https://en.wikipedia.org/wiki/Software_versioning> .



52 changes: 52 additions & 0 deletions ontologies/te.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
@prefix pe: <http://www.softlang.org/ontologies/pe#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tbox: <http://www.softlang.org/ontologies/tbox#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://www.softlang.org/ontologies/te> a owl:Ontology ;
tbox:commentingPolicy "See http://www.softlang.org/ontologies/tbox -- the same policy applies here."@en ;
Expand Down Expand Up @@ -305,8 +307,58 @@
owl:NamedIndividual ;
rdfs:label "CPython"@en ;
rdfs:comment "reference interpreter implementation of the Python programming language"@en ;
tbox:hasVersion :CPython_2_7,
:CPython_3_6,
:CPython_3_12 ;
foaf:isPrimaryTopicOf <https://en.wikipedia.org/wiki/CPython> .

# CPython version history — SAREF time-series pattern PoC (technology side)

:CPython_2_7 a tbox:ToolEntity,
tbox:ToolVersion,
owl:NamedIndividual ;
rdfs:label "CPython 2.7"@en ;
tbox:versionOf :CPython ;
tbox:versionTag "2.7" ;
tbox:releaseDate :CPython_2_7_release ;
tbox:hasSuccessor :CPython_3_6 ;
rdfs:comment "CPython 2.7 is the final release of the CPython 2.x series; end-of-life 2020-01-01."@en ;
foaf:page <https://en.wikipedia.org/wiki/CPython> .

:CPython_3_6 a tbox:ToolEntity,
tbox:ToolVersion,
owl:NamedIndividual ;
rdfs:label "CPython 3.6"@en ;
tbox:versionOf :CPython ;
tbox:versionTag "3.6" ;
tbox:releaseDate :CPython_3_6_release ;
tbox:hasPredecessor :CPython_2_7 ;
tbox:hasSuccessor :CPython_3_12 ;
rdfs:comment "CPython 3.6 corresponds to the Python 3.6 language release."@en ;
foaf:page <https://en.wikipedia.org/wiki/CPython> .

:CPython_3_12 a tbox:ToolEntity,
tbox:ToolVersion,
owl:NamedIndividual ;
rdfs:label "CPython 3.12"@en ;
tbox:versionOf :CPython ;
tbox:versionTag "3.12" ;
tbox:releaseDate :CPython_3_12_release ;
tbox:hasPredecessor :CPython_3_6 ;
rdfs:comment "CPython 3.12 is the current active release corresponding to the Python 3.12 language version."@en ;
foaf:page <https://en.wikipedia.org/wiki/CPython> .

# OWL-Time Instant individuals for CPython version releases

:CPython_2_7_release a time:Instant ;
time:inXSDDate "2010-07-03"^^xsd:date .

:CPython_3_6_release a time:Instant ;
time:inXSDDate "2016-12-23"^^xsd:date .

:CPython_3_12_release a time:Instant ;
time:inXSDDate "2023-10-02"^^xsd:date .

:Drools a tbox:ToolEntity,
:RuleEngine,
owl:NamedIndividual ;
Expand Down
1 change: 1 addition & 0 deletions queries/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ all:
cd constraints; make
cd issues; make
cd references; make
cd saref_experiment; make

3 changes: 3 additions & 0 deletions queries/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def fsl_graph():
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX tbox: <http://www.softlang.org/ontologies/tbox#>
PREFIX ie: <http://www.softlang.org/ontologies/ie#>
PREFIX pe: <http://www.softlang.org/ontologies/pe#>
PREFIX te: <http://www.softlang.org/ontologies/te#>
PREFIX time: <http://www.w3.org/2006/time#>
"""

def local_name(value):
Expand Down
15 changes: 15 additions & 0 deletions queries/saref_experiment/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
all:
make version_sequence.run
make successor_chain.run
make cross_entity_versions.run
make language_tool_pairing.run
python3 summary.py

summary.csv: *.log summary.py
python3 summary.py

%.run:
python3 $*.py > $*.log

clean:
rm -f *.log *.csv
31 changes: 31 additions & 0 deletions queries/saref_experiment/cross_entity_versions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from pathlib import Path
from rdflib import Graph

# Parse all Turtle files of the ontology
ttl_dir = Path("../../ontologies")
ttl_files = sorted(ttl_dir.glob("*.ttl"))
g = Graph()
for ttl in ttl_files:
g.parse(ttl, format="turtle")

# All versions across both LanguageVersion and ToolVersion individuals
# Demonstrates the pattern covers "languages and technologies" as SAREF suggests
query = """
PREFIX tbox: <http://www.softlang.org/ontologies/tbox#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT ?entityLabel ?tag ?date WHERE {
?entity tbox:hasVersion ?version .
?version tbox:versionTag ?tag ;
tbox:releaseDate ?instant .
?instant time:inXSDDate ?date .
?entity rdfs:label ?entityLabel .
FILTER (?date > "2015-01-01"^^xsd:date)
}
ORDER BY ?entityLabel ?date
"""

for row in g.query(query):
print(f"{row['entityLabel']}\t{row['tag']}\t{row['date']}")
Loading