Skip to content

Commit bcfe032

Browse files
committed
pysema addition and also dcat catalog addition to the metadata.ttl
1 parent f892381 commit bcfe032

File tree

5 files changed

+105
-123
lines changed

5 files changed

+105
-123
lines changed

pysubyt/commands.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rm -rf ./outputs/*
55

66
#then run the pysubyt command
77
echo "running the pysubyt commands"
8-
python -m pysubyt -t ./templates/ \
8+
sema-subyt -t ./templates/ \
99
-s contact ../src/data/contacts.json \
1010
-s main ../src/data/main_data.json \
1111
-s publications ../src/data/publications.json \

pysubyt/outputs/metadata.ttl

Lines changed: 68 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
44
@prefix dc: <http://purl.org/dc/elements/1.1/> .
55
@prefix da: <https://open-vocabularies.vliz.be/dmbonassistant#> .
6+
@prefix dcat: <http://www.w3.org/ns/dcat#> .
67
@prefix schema: <http://schema.org/> .
78

89
<https://orcid.org/0000-0003-0264-9631>
@@ -36,132 +37,125 @@
3637
.
3738

3839

39-
<base_uri> rdf:type foaf:Project ;
40+
41+
<base_uri> rdf:type foaf:Project dcat:Catalog ;
4042
dc:title "Autonomous Reef Monitoring System" ;
4143
foaf:name "ARMS" ;
4244
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)." ;
43-
foaf:logo <https://www.researchobject.org/ro-crate/assets/img/ro-crate-w-text.svg>;
44-
schema:mainEntityOfPage <base_uri>;
45-
schema:hasPart [
46-
rdf:type schema:ItemList;
47-
schema:partOf <base_uri>;
48-
schema:name "Profiles in Autonomous Reef Monitoring System" ;
49-
schema:itemListElement <http://www.google.com>;
50-
schema:itemListElement <http://www.google.com>;
51-
schema:itemListElement <http://www.google.com>;
52-
schema:itemListElement <http://www.google.com>;
53-
],
54-
[
55-
rdf:type schema:ItemList;
56-
schema:partOf <base_uri>;
57-
schema:name "Crates in Autonomous Reef Monitoring System" ;
58-
schema:itemListElement <http://www.google.com>;
59-
schema:itemListElement <base_uri/Data/QualityControlledData>;
60-
schema:itemListElement <base_uri/Data/QualityControlledData/FromPlutoF>;
61-
schema:itemListElement <http://www.google.com>;
62-
schema:itemListElement <http://www.google.com>;
63-
schema:itemListElement <http://www.google.com>;
64-
schema:itemListElement <http://www.google.com>;
65-
schema:itemListElement <http://www.google.com>;
66-
];
67-
68-
schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
69-
70-
schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
71-
72-
schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
73-
74-
schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
75-
76-
.
77-
45+
foaf:logo <https://www.researchobject.org/ro-crate/assets/img/ro-crate-w-text.svg> ;
46+
schema:mainEntityOfPage <base_uri> ;
47+
foas:homepage <base_uri> ;
48+
dcat:dataset
49+
<http://www.google.com>,
50+
<http://www.google.com>,
51+
<http://www.google.com>,
52+
<http://www.google.com>,
53+
54+
<base_urihttps://w3id.org/ro/crate/1/lod>,
55+
<base_uri/Data/QualityControlledData>,
56+
<base_uri/Data/QualityControlledData/FromPlutoF>,
57+
<base_urihttps://w3id.org/ro/crate/1/lod>,
58+
<base_uri>,
59+
<base_urihttps://w3id.org/ro/crate/1/lod>,
60+
<base_urihttps://w3id.org/ro/crate/1/lod>,
61+
<base_urihttps://w3id.org/ro/crate/1/lod>
62+
#
63+
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
64+
#
65+
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
66+
#
67+
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
68+
#
69+
# schema:hasPart <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley>;
70+
#
7871
<https://www.researchobject.org/ro-crate/assets/img/ro-crate-w-text.svg> rdf:type foaf:Image
7972
.
8073

8174

82-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
75+
<http://www.google.com> rdf:type dcat:Dataset, schema:CreativeWork ;
8376
dc:title "Lorem ipsum" ;
8477
dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ;
8578
schema:item <http://www.google.com> ;
8679
.
8780

88-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
81+
<http://www.google.com> rdf:type dcat:Dataset, schema:CreativeWork ;
8982
dc:title "Lorem ipsum" ;
9083
dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ;
9184
schema:item <http://www.google.com> ;
9285
.
9386

94-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
87+
<http://www.google.com> rdf:type dcat:Dataset, schema:CreativeWork ;
9588
dc:title "Lorem ipsum" ;
9689
dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ;
9790
schema:item <http://www.google.com> ;
9891
.
9992

100-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
93+
<http://www.google.com> rdf:type dcat:Dataset, schema:CreativeWork ;
10194
dc:title "Lorem ipsum" ;
10295
dc:description "Lorem ipsum dolor sit amet placerat facilisis felis mi in tempus eleifend pellentesque natoque etiam." ;
10396
schema:item <http://www.google.com> ;
10497
.
10598

106-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
99+
<https://w3id.org/ro/crate/1/lod> rdf:type dcat:Dataset, schema:CreativeWork ;
107100
dc:title "Lorem ipsum dolor" ;
108101
dc:description "Lorem ipsum dolor sit amet, consectetur adipiscing elit." ;
109102
schema:item <http://www.google.com> ;
110103
.
111-
<base_uri/Data/QualityControlledData> rdf:type schema:ListItem, schema:CreativeWork ;
104+
<base_uri/QualityControlledData> rdf:type dcat:Dataset, schema:CreativeWork ;
112105
dc:description "This is the repository for data taken from different sources, which are then quality controlled and combined" ;
113-
schema:item <base_uri/Data/QualityControlledData>;
106+
schema:item <base_uri/QualityControlledData>;
114107
.
115-
<base_uri/Data/QualityControlledData/FromPlutoF> rdf:type schema:ListItem, schema:CreativeWork ;
108+
<base_uri/QualityControlledData/FromPlutoF> rdf:type dcat:Dataset, schema:CreativeWork ;
116109
dc:description "The metadata taken from PlutoF, which are quality controlled" ;
117-
schema:item <base_uri/Data/QualityControlledData/FromPlutoF>;
110+
schema:item <base_uri/QualityControlledData/FromPlutoF>;
118111
.
119-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
112+
<https://w3id.org/ro/crate/1/lod> rdf:type dcat:Dataset, schema:CreativeWork ;
120113
dc:title "Consectetur adipiscing" ;
121114
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." ;
122115
schema:item <http://www.google.com> ;
123116
.
124-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
117+
<> rdf:type dcat:Dataset, schema:CreativeWork ;
125118
dc:title "Lorem ipsum dolor" ;
126119
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." ;
127120
schema:item <http://www.google.com> ;
128121
.
129-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
122+
<https://w3id.org/ro/crate/1/lod> rdf:type dcat:Dataset, schema:CreativeWork ;
130123
dc:title "Consectetur adipiscing" ;
131124
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." ;
132125
schema:item <http://www.google.com> ;
133126
.
134-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
127+
<https://w3id.org/ro/crate/1/lod> rdf:type dcat:Dataset, schema:CreativeWork ;
135128
dc:title "Lorem ipsum dolor" ;
136129
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." ;
137130
schema:item <http://www.google.com> ;
138131
.
139-
<http://www.google.com> rdf:type schema:ListItem, schema:CreativeWork ;
132+
<https://w3id.org/ro/crate/1/lod> rdf:type dcat:Dataset, schema:CreativeWork ;
140133
dc:title "Consectetur adipiscing" ;
141134
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." ;
142135
schema:item <http://www.google.com> ;
143136
.
144-
145-
<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
146-
dc:title "Something Something interesting" ;
147-
dc:description "Text about something interesting here A" ;
148-
schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
149-
.
150-
151-
<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
152-
dc:title "The cat in the hat" ;
153-
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." ;
154-
schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
155-
.
156-
157-
<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
158-
dc:title "The bone in the bone" ;
159-
dc:description "Spooky scary skeletons send shivers down your spine. Shrieking skulls will shock your soul, seal your doom tonight." ;
160-
schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
161-
.
162-
163-
<https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
164-
dc:title "The eel in the seal caught the whale in the mail" ;
165-
dc:description "The eel in the seal caught the whale in the mail. The whale in the mail was a very big whale." ;
166-
schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
167-
.
137+
#
138+
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
139+
# dc:title "Something Something interesting" ;
140+
# dc:description "Text about something interesting here A" ;
141+
# schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
142+
# .
143+
#
144+
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
145+
# dc:title "The cat in the hat" ;
146+
# 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." ;
147+
# schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
148+
# .
149+
#
150+
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
151+
# dc:title "The bone in the bone" ;
152+
# dc:description "Spooky scary skeletons send shivers down your spine. Shrieking skulls will shock your soul, seal your doom tonight." ;
153+
# schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
154+
# .
155+
#
156+
# <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> rdf:type schema:CreativeWork ;
157+
# dc:title "The eel in the seal caught the whale in the mail" ;
158+
# dc:description "The eel in the seal caught the whale in the mail. The whale in the mail was a very big whale." ;
159+
# schema:url <https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley> ;
160+
# .
161+
#

pysubyt/sema.log

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
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)
2+
2024-11-20 14:49:39 @sources.py [DEBUG ] mapping ext 'json' to mime 'None'
3+
2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None'
4+
2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None'
5+
2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None'
6+
2024-11-20 14:49:40 @sources.py [DEBUG ] mapping ext 'json' to mime 'None'
7+
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)}
8+
2024-11-20 14:49:40 @api.py [DEBUG ] processing item _ = None
9+
2024-11-20 14:49:40 @sinks.py [INFO ] Creating outputs/metadata.ttl
10+
2024-11-20 14:49:40 @__main__.py [DEBUG ] processing done

pysubyt/templates/metadata.ttl

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
44
@prefix dc: <http://purl.org/dc/elements/1.1/> .
55
@prefix da: <https://open-vocabularies.vliz.be/dmbonassistant#> .
6+
@prefix dcat: <http://www.w3.org/ns/dcat#> .
67
@prefix schema: <http://schema.org/> .
78

89
{% for contacte in sets['contact'] -%}
@@ -15,62 +16,39 @@
1516
.
1617

1718
{% endfor %}
19+
1820
{% for maindata in sets['main'] -%}
19-
<{{base_uri}}> rdf:type foaf:Project ;
21+
<{{base_uri}}> rdf:type foaf:Project dcat:Catalog ;
2022
dc:title "{{maindata.long_name}}" ;
2123
foaf:name "{{maindata.name_site}}" ;
2224
dc:description "{{maindata.description}}" ;
23-
foaf:logo <{{maindata.logo}}>;
24-
schema:mainEntityOfPage <{{base_uri}}>;
25-
schema:hasPart [
26-
rdf:type schema:ItemList;
27-
schema:partOf <{{base_uri}}>;
28-
schema:name "Profiles in {{maindata.long_name}}" ;
29-
{% for profile in sets['project_profile'] -%}
30-
schema:itemListElement <{{profile.url}}>;
31-
{% endfor -%}
32-
],
33-
[
34-
rdf:type schema:ItemList;
35-
schema:partOf <{{base_uri}}>;
36-
schema:name "Crates in {{maindata.long_name}}" ;
37-
{% for crate in sets['project_crate'] -%}
38-
{% if crate.index -%}
39-
{% for index in crate.index -%}
40-
schema:itemListElement <{{base_uri}}{{crate.url}}{{index.path}}>;
41-
{% endfor -%}
42-
{% else -%}
43-
schema:itemListElement <{{base_uri}}{{crate.lodurl}}>;
44-
{% endif -%}
45-
{% endfor -%}
46-
],
47-
[
48-
rdf:type schema:ItemList;
49-
schema:partOf <{{base_uri}}>;
50-
schema:name "Vocabularies in {{maindata.long_name}}" ;
51-
{% for vocab in sets['vocabulary'] -%}
52-
schema:itemListElement <{{vocab}}>;
53-
{% endfor -%}
54-
],
55-
[
56-
rdf:type schema:ItemList;
57-
schema:partOf <{{base_uri}}>;
58-
schema:name "Ontologies in {{maindata.long_name}}" ;
59-
{% for vocab in sets['ontology'] -%}
60-
schema:itemListElement <{{vocab}}>;
61-
{% endfor -%}
62-
];
25+
foaf:logo <{{maindata.logo}}> ;
26+
schema:mainEntityOfPage <{{base_uri}}> ;
27+
foas:homepage <{{base_uri}}> ;
28+
dcat:dataset
29+
{% for profile in sets['project_profile'] -%}
30+
<{{profile.url}}>,
31+
{% endfor %}
32+
{% for crate in sets['project_crate'] -%}
33+
{% if crate.index -%}
34+
{% for index in crate.index -%}
35+
<{{base_uri}}{{crate.url}}{{index.path}}>,
36+
{% endfor -%}
37+
{% else -%}
38+
<{{base_uri}}{{crate.lodurl}}>{% if not crate == sets['project_crate']|list|last %},{% endif %}
39+
{% endif -%}
40+
{% endfor -%}
41+
42+
6343
# {% for publication in sets['publications']%}
6444
# schema:hasPart <{{publication.link}}>;
6545
# {% endfor %}
66-
.
67-
6846
<{{maindata.logo}}> rdf:type foaf:Image
6947
.
70-
7148
{% endfor %}
49+
7250
{% for profile in sets['project_profile'] -%}
73-
<{{profile.url}}> rdf:type schema:ListItem, schema:CreativeWork ;
51+
<{{profile.url}}> rdf:type dcat:Dataset, schema:CreativeWork ;
7452
dc:title "{{profile.title}}" ;
7553
dc:description "{{profile.text}}" ;
7654
schema:item <{{profile.url}}> ;
@@ -80,13 +58,13 @@
8058
{% for crate in sets['project_crate'] -%}
8159
{% if crate.index -%}
8260
{% for index in crate.index -%}
83-
<{{base_uri}}{{crate.lodurl}}{{index.path}}> rdf:type schema:ListItem, schema:CreativeWork ;
61+
<{{base_uri}}{{crate.lodurl}}{{index.path}}> rdf:type dcat:Dataset, schema:CreativeWork ;
8462
dc:description "{{index.label}}" ;
8563
schema:item <{{base_uri}}{{crate.lodurl}}{{index.path}}>;
8664
.
8765
{% endfor -%}
8866
{% else -%}
89-
<{{crate.lodurl}}> rdf:type schema:ListItem, schema:CreativeWork ;
67+
<{{crate.lodurl}}> rdf:type dcat:Dataset, schema:CreativeWork ;
9068
dc:title "{{crate.name}}" ;
9169
dc:description "{{crate.text}}" ;
9270
schema:item <{{crate.url}}> ;

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git+https://github.com/vliz-be-opsci/pysembench.git@main
1+
git+https://github.com/vliz-be-opsci/py-sema.git@main

0 commit comments

Comments
 (0)