Skip to content

Commit

Permalink
pysema addition and also dcat catalog addition to the metadata.ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricdcc committed Nov 20, 2024
1 parent f892381 commit bcfe032
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 123 deletions.
2 changes: 1 addition & 1 deletion pysubyt/commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
142 changes: 68 additions & 74 deletions pysubyt/outputs/metadata.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix da: <https://open-vocabularies.vliz.be/dmbonassistant#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix schema: <http://schema.org/> .

<https://orcid.org/0000-0003-0264-9631>
Expand Down Expand Up @@ -36,132 +37,125 @@
.


<base_uri> rdf:type foaf:Project ;

<base_uri> 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 <https://www.researchobject.org/ro-crate/assets/img/ro-crate-w-text.svg>;
schema:mainEntityOfPage <base_uri>;
schema:hasPart [
rdf:type schema:ItemList;
schema:partOf <base_uri>;
schema:name "Profiles in Autonomous Reef Monitoring System" ;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <http://www.google.com>;
],
[
rdf:type schema:ItemList;
schema:partOf <base_uri>;
schema:name "Crates in Autonomous Reef Monitoring System" ;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <base_uri/Data/QualityControlledData>;
schema:itemListElement <base_uri/Data/QualityControlledData/FromPlutoF>;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <http://www.google.com>;
schema:itemListElement <http://www.google.com>;
];

schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;

schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;

schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;

schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;

.

foaf:logo <https://www.researchobject.org/ro-crate/assets/img/ro-crate-w-text.svg> ;
schema:mainEntityOfPage <base_uri> ;
foas:homepage <base_uri> ;
dcat:dataset
<http://www.google.com>,
<http://www.google.com>,
<http://www.google.com>,
<http://www.google.com>,

<base_urihttps://w3id.org/ro/crate/1/lod>,
<base_uri/Data/QualityControlledData>,
<base_uri/Data/QualityControlledData/FromPlutoF>,
<base_urihttps://w3id.org/ro/crate/1/lod>,
<base_uri>,
<base_urihttps://w3id.org/ro/crate/1/lod>,
<base_urihttps://w3id.org/ro/crate/1/lod>,
<base_urihttps://w3id.org/ro/crate/1/lod>
#
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
#
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
#
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
#
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
#
<https://www.researchobject.org/ro-crate/assets/img/ro-crate-w-text.svg> rdf:type foaf:Image
.


<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<http://www.google.com> 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 <http://www.google.com> ;
.

<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<http://www.google.com> 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 <http://www.google.com> ;
.

<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<http://www.google.com> 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 <http://www.google.com> ;
.

<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<http://www.google.com> 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 <http://www.google.com> ;
.

<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<https://w3id.org/ro/crate/1/lod> rdf:type dcat:Dataset, schema:CreativeWork ;
dc:title "Lorem ipsum dolor" ;
dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit." ;
schema:item <http://www.google.com> ;
.
<base_uri/Data/QualityControlledData> rdf:type schema:ListItem, schema:CreativeWork ;
<base_uri/QualityControlledData> 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 <base_uri/Data/QualityControlledData>;
schema:item <base_uri/QualityControlledData>;
.
<base_uri/Data/QualityControlledData/FromPlutoF> rdf:type schema:ListItem, schema:CreativeWork ;
<base_uri/QualityControlledData/FromPlutoF> rdf:type dcat:Dataset, schema:CreativeWork ;
dc:description "The metadata taken from PlutoF, which are quality controlled" ;
schema:item <base_uri/Data/QualityControlledData/FromPlutoF>;
schema:item <base_uri/QualityControlledData/FromPlutoF>;
.
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<https://w3id.org/ro/crate/1/lod> 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 <http://www.google.com> ;
.
<http://www.google.com> 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 <http://www.google.com> ;
.
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<https://w3id.org/ro/crate/1/lod> 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 <http://www.google.com> ;
.
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<https://w3id.org/ro/crate/1/lod> 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 <http://www.google.com> ;
.
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
<https://w3id.org/ro/crate/1/lod> 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 <http://www.google.com> ;
.

<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
dc:title "Something Something interesting" ;
dc:description "Text about something interesting here A" ;
schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
.

<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> 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 <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
.

<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> 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 <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
.

<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> 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 <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
.
#
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
# dc:title "Something Something interesting" ;
# dc:description "Text about something interesting here A" ;
# schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
# .
#
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> 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 <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
# .
#
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> 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 <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
# .
#
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> 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 <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
# .
#
10 changes: 10 additions & 0 deletions pysubyt/sema.log
Original file line number Diff line number Diff line change
@@ -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
72 changes: 25 additions & 47 deletions pysubyt/templates/metadata.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix da: <https://open-vocabularies.vliz.be/dmbonassistant#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix schema: <http://schema.org/> .

{% for contacte in sets['contact'] -%}
Expand All @@ -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}}> ;
Expand All @@ -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}}> ;
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git+https://github.com/vliz-be-opsci/pysembench.git@main
git+https://github.com/vliz-be-opsci/py-sema.git@main

0 comments on commit bcfe032

Please sign in to comment.