diff --git a/pysubyt/commands.sh b/pysubyt/commands.sh index 18e5bde..416bfd3 100644 --- a/pysubyt/commands.sh +++ b/pysubyt/commands.sh @@ -5,7 +5,7 @@ rm -rf ./outputs/* #then run the pysubyt command echo "running the pysubyt commands" -python -m pysubyt -t ./templates/ \ +sema-subyt -t ./templates/ \ -s contact ../src/data/contacts.json \ -s main ../src/data/main_data.json \ -s publications ../src/data/publications.json \ diff --git a/pysubyt/outputs/metadata.ttl b/pysubyt/outputs/metadata.ttl index 4570c50..b223e4b 100644 --- a/pysubyt/outputs/metadata.ttl +++ b/pysubyt/outputs/metadata.ttl @@ -3,6 +3,7 @@ @prefix foaf: . @prefix dc: . @prefix da: . +@prefix dcat: . @prefix schema: . @@ -36,132 +37,125 @@ . - rdf:type foaf:Project ; + + rdf:type foaf:Project dcat:Catalog ; dc:title "Autonomous Reef Monitoring System" ; foaf:name "ARMS" ; dc:description "The European ARMS programme (ARMS-MBON) is a network of Autonomous Reef Monitoring Structures (ARMS) placed in the vicinity of marine stations, ports, marinas, and Long-Term Ecological Research (LTER) sites distributed over Europe and polar regions. The aim of ARMS-MBON is to assess the status of, and changes in, hard-bottom communities of near-coast environments, using genetic methods supplemented with image analysis and visual inspection methods. ARMS-MBON is part of GEO BONs Marine Biodiversity Observation Network (MBON)." ; - foaf:logo ; - schema:mainEntityOfPage ; - schema:hasPart [ - rdf:type schema:ItemList; - schema:partOf ; - schema:name "Profiles in Autonomous Reef Monitoring System" ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - ], - [ - rdf:type schema:ItemList; - schema:partOf ; - schema:name "Crates in Autonomous Reef Monitoring System" ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - schema:itemListElement ; - ]; - - schema:hasPart ; - - schema:hasPart ; - - schema:hasPart ; - - schema:hasPart ; - - . - + foaf:logo ; + schema:mainEntityOfPage ; + foas:homepage ; + dcat:dataset + , + , + , + , + + , + , + , + , + , + , + , + + # + # schema:hasPart ; + # + # schema:hasPart ; + # + # schema:hasPart ; + # + # schema:hasPart ; + # rdf:type foaf:Image . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Lorem ipsum" ; dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Lorem ipsum" ; dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Lorem ipsum" ; dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Lorem ipsum" ; dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Lorem ipsum dolor" ; dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:description "This is the repository for data taken from different sources, which are then quality controlled and combined" ; - schema:item ; + schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:description "The metadata taken from PlutoF, which are quality controlled" ; - schema:item ; + schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Consectetur adipiscing" ; dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sed dapibus leo nec ornare diam sedasd commodo nibh ante facilisis bibendum dolor feugiat at." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; +<> rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Lorem ipsum dolor" ; dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sed dapibus leo nec ornare diam sedasd commodo nibh ante facilisis bibendum dolor feugiat at." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Consectetur adipiscing" ; dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sed dapibus leo nec ornare diam sedasd commodo nibh ante facilisis bibendum dolor feugiat at." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Lorem ipsum dolor" ; dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sed dapibus leo nec ornare diam sedasd commodo nibh ante facilisis bibendum dolor feugiat at." ; schema:item ; . - rdf:type schema:ListItem, schema:CreativeWork ; + rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "Consectetur adipiscing" ; dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sed dapibus leo nec ornare diam sedasd commodo nibh ante facilisis bibendum dolor feugiat at." ; schema:item ; . - - rdf:type schema:CreativeWork ; - dc:title "Something Something interesting" ; - dc:description "Text about something interesting here A" ; - schema:url ; - . - - rdf:type schema:CreativeWork ; - dc:title "The cat in the hat" ; - dc:description "The cat in the hat sat on the mat. One hopes he didn't leave a fat cat track in the form of a shattered mat." ; - schema:url ; - . - - rdf:type schema:CreativeWork ; - dc:title "The bone in the bone" ; - dc:description "Spooky scary skeletons send shivers down your spine. Shrieking skulls will shock your soul, seal your doom tonight." ; - schema:url ; - . - - rdf:type schema:CreativeWork ; - dc:title "The eel in the seal caught the whale in the mail" ; - dc:description "The eel in the seal caught the whale in the mail. The whale in the mail was a very big whale." ; - schema:url ; - . +# +# rdf:type schema:CreativeWork ; +# dc:title "Something Something interesting" ; +# dc:description "Text about something interesting here A" ; +# schema:url ; +# . +# +# rdf:type schema:CreativeWork ; +# dc:title "The cat in the hat" ; +# dc:description "The cat in the hat sat on the mat. One hopes he didn't leave a fat cat track in the form of a shattered mat." ; +# schema:url ; +# . +# +# rdf:type schema:CreativeWork ; +# dc:title "The bone in the bone" ; +# dc:description "Spooky scary skeletons send shivers down your spine. Shrieking skulls will shock your soul, seal your doom tonight." ; +# schema:url ; +# . +# +# rdf:type schema:CreativeWork ; +# dc:title "The eel in the seal caught the whale in the mail" ; +# dc:description "The eel in the seal caught the whale in the mail. The whale in the mail was a very big whale." ; +# schema:url ; +# . +# \ No newline at end of file diff --git a/pysubyt/sema.log b/pysubyt/sema.log new file mode 100644 index 0000000..f25fafc --- /dev/null +++ b/pysubyt/sema.log @@ -0,0 +1,10 @@ +2024-11-20 14:49:39 @clitools.py [DEBUG ] sema-subyt parsed args ns=Namespace(logconf=None, name='metadata.ttl', set=[['contact', '../src/data/contacts.json'], ['main', '../src/data/main_data.json'], ['publications', '../src/data/publications.json'], ['project_crate', '../src/data/project_crates.json'], ['project_profile', '../src/data/project_profiles.json']], var=[['base_uri', 'base_uri']], templates='./templates/', input=None, output='outputs/metadata.ttl', force=False, mode=None, allow_repeated_sink_paths=False, conditional=False) +2024-11-20 14:49:39 @sources.py [DEBUG ] mapping ext 'json' to mime 'None' +2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None' +2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None' +2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None' +2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None' +2024-11-20 14:49:40 @subyt.py [DEBUG ] Subyt initialized with {'template_name': 'metadata.ttl', '_inputs': {'contact': JsonFileSource('C:\Users\cedricd\Documents\GitHub\space-to-pages\src\data\contacts.json'), 'main': JsonFileSource('C:\Users\cedricd\Documents\GitHub\space-to-pages\src\data\main_data.json'), 'publications': JsonFileSource('C:\Users\cedricd\Documents\GitHub\space-to-pages\src\data\publications.json'), 'project_crate': JsonFileSource('C:\Users\cedricd\Documents\GitHub\space-to-pages\src\data\project_crates.json'), 'project_profile': JsonFileSource('C:\Users\cedricd\Documents\GitHub\space-to-pages\src\data\project_profiles.json')}, '_conditional': False, '_variables': {'base_uri': 'base_uri'}, '_generator_settings': GeneratorSettings('ignorecase,flatten,iteration'), '_sink': SingleFileSink('C:\Users\cedricd\Documents\GitHub\space-to-pages\pysubyt\outputs\metadata.ttl', False)} +2024-11-20 14:49:40 @api.py [DEBUG ] processing item _ = None +2024-11-20 14:49:40 @sinks.py [INFO ] Creating outputs/metadata.ttl +2024-11-20 14:49:40 @__main__.py [DEBUG ] processing done diff --git a/pysubyt/templates/metadata.ttl b/pysubyt/templates/metadata.ttl index 2b91dfc..1eccdee 100644 --- a/pysubyt/templates/metadata.ttl +++ b/pysubyt/templates/metadata.ttl @@ -3,6 +3,7 @@ @prefix foaf: . @prefix dc: . @prefix da: . +@prefix dcat: . @prefix schema: . {% for contacte in sets['contact'] -%} @@ -15,62 +16,39 @@ . {% endfor %} + {% for maindata in sets['main'] -%} -<{{base_uri}}> rdf:type foaf:Project ; +<{{base_uri}}> rdf:type foaf:Project dcat:Catalog ; dc:title "{{maindata.long_name}}" ; foaf:name "{{maindata.name_site}}" ; dc:description "{{maindata.description}}" ; - foaf:logo <{{maindata.logo}}>; - schema:mainEntityOfPage <{{base_uri}}>; - schema:hasPart [ - rdf:type schema:ItemList; - schema:partOf <{{base_uri}}>; - schema:name "Profiles in {{maindata.long_name}}" ; - {% for profile in sets['project_profile'] -%} - schema:itemListElement <{{profile.url}}>; - {% endfor -%} - ], - [ - rdf:type schema:ItemList; - schema:partOf <{{base_uri}}>; - schema:name "Crates in {{maindata.long_name}}" ; - {% for crate in sets['project_crate'] -%} - {% if crate.index -%} - {% for index in crate.index -%} - schema:itemListElement <{{base_uri}}{{crate.url}}{{index.path}}>; - {% endfor -%} - {% else -%} - schema:itemListElement <{{base_uri}}{{crate.lodurl}}>; - {% endif -%} - {% endfor -%} - ], - [ - rdf:type schema:ItemList; - schema:partOf <{{base_uri}}>; - schema:name "Vocabularies in {{maindata.long_name}}" ; - {% for vocab in sets['vocabulary'] -%} - schema:itemListElement <{{vocab}}>; - {% endfor -%} - ], - [ - rdf:type schema:ItemList; - schema:partOf <{{base_uri}}>; - schema:name "Ontologies in {{maindata.long_name}}" ; - {% for vocab in sets['ontology'] -%} - schema:itemListElement <{{vocab}}>; - {% endfor -%} - ]; + foaf:logo <{{maindata.logo}}> ; + schema:mainEntityOfPage <{{base_uri}}> ; + foas:homepage <{{base_uri}}> ; + dcat:dataset + {% for profile in sets['project_profile'] -%} + <{{profile.url}}>, + {% endfor %} + {% for crate in sets['project_crate'] -%} + {% if crate.index -%} + {% for index in crate.index -%} + <{{base_uri}}{{crate.url}}{{index.path}}>, + {% endfor -%} + {% else -%} + <{{base_uri}}{{crate.lodurl}}>{% if not crate == sets['project_crate']|list|last %},{% endif %} + {% endif -%} + {% endfor -%} + + # {% for publication in sets['publications']%} # schema:hasPart <{{publication.link}}>; # {% endfor %} - . - <{{maindata.logo}}> rdf:type foaf:Image . - {% endfor %} + {% for profile in sets['project_profile'] -%} -<{{profile.url}}> rdf:type schema:ListItem, schema:CreativeWork ; +<{{profile.url}}> rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "{{profile.title}}" ; dc:description "{{profile.text}}" ; schema:item <{{profile.url}}> ; @@ -80,13 +58,13 @@ {% for crate in sets['project_crate'] -%} {% if crate.index -%} {% for index in crate.index -%} -<{{base_uri}}{{crate.lodurl}}{{index.path}}> rdf:type schema:ListItem, schema:CreativeWork ; +<{{base_uri}}{{crate.lodurl}}{{index.path}}> rdf:type dcat:Dataset, schema:CreativeWork ; dc:description "{{index.label}}" ; schema:item <{{base_uri}}{{crate.lodurl}}{{index.path}}>; . {% endfor -%} {% else -%} -<{{crate.lodurl}}> rdf:type schema:ListItem, schema:CreativeWork ; +<{{crate.lodurl}}> rdf:type dcat:Dataset, schema:CreativeWork ; dc:title "{{crate.name}}" ; dc:description "{{crate.text}}" ; schema:item <{{crate.url}}> ; diff --git a/requirements.txt b/requirements.txt index 6b7a602..7c3dbbf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -git+https://github.com/vliz-be-opsci/pysembench.git@main \ No newline at end of file +git+https://github.com/vliz-be-opsci/py-sema.git@main \ No newline at end of file