Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Notice Package templates #39

Merged
merged 1 commit into from
Mar 25, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,32 @@
<metsDocumentID>{{ notice.id }}_mets2{{ notice.action.type }}</metsDocumentID>
</metsHdr>
<dmdSec ID="dmdSec01">
<mdRef MDTYPE="OTHER" LOCTYPE="URL" MIMETYPE="application/rdf+xml" OTHERMDTYPE="INSTANCE"
xlink:href="{{ notice.id }}-0.mets.xml.dmd.rdf"/>
<mdRef MDTYPE="OTHER" LOCTYPE="URL" MIMETYPE="application/rdf+xml" OTHERMDTYPE="INSTANCE" xlink:href="{{ notice.id }}-0.mets.xml.dmd.rdf"/>
</dmdSec>
<amdSec>
<techMD ID="techMDID001">
<mdRef MDTYPE="OTHER" LOCTYPE="URL" MIMETYPE="application/rdf+xml"
OTHERMDTYPE="INSTANCE" xlink:href="techMDID001.tmd.rdf"/>
<mdRef MDTYPE="OTHER" LOCTYPE="URL" MIMETYPE="application/rdf+xml" OTHERMDTYPE="INSTANCE" xlink:href="techMDID001.tmd.rdf"/>
</techMD>
</amdSec>
<fileSec>
<fileGrp>
<file ID="file-001" MIMETYPE="application/rdf+xml"
CHECKSUM="f9cdda52af5e532068547f0c91fcf186840bd088 " CHECKSUMTYPE="SHA-1">
<file ID="file-001" MIMETYPE="application/rdf+xml" CHECKSUM="f9cdda52af5e532068547f0c91fcf186840bd088 " CHECKSUMTYPE="SHA-1">
<FLocat LOCTYPE="URL" xlink:href="{{ notice.id }}.rdf"/>
</file>
</fileGrp>
</fileSec>
<structMap ID="structMap01">
<div TYPE="work" CONTENTIDS="dataset:{{ notice.id }}" DMDID="dmdSec01" ID="w-01">
<div TYPE="expression" CONTENTIDS="expression:{{ notice.id }}"
DMDID="dmdSec01" ID="e-01">
<div TYPE="manifestation"
CONTENTIDS="distribution:{{ notice.id }}/{{ notice.id }}_rdf"
DMDID="dmdSec01" ADMID="techMDID001" ID="m-001">
<fptr
CONTENTIDS="distribution:{{ notice.id }}/{{ notice.id }}.rdf"
FILEID="file-001"/>
<div TYPE="expression" CONTENTIDS="expression:{{ notice.id }}" DMDID="dmdSec01" ID="e-01">
<div TYPE="manifestation" CONTENTIDS="distribution:{{ notice.id }}/{{ notice.id }}_rdf" DMDID="dmdSec01" ADMID="techMDID001" ID="m-001">
<fptr CONTENTIDS="distribution:{{ notice.id }}/{{ notice.id }}.rdf" FILEID="file-001"/>
</div>
</div>
</div>
</structMap>
<behaviorSec>
<behavior BTYPE="sparql-load" STRUCTID="m-001">
<mechanism LOCTYPE="URL" LABEL="Sparql-load"
xlink:href="cellar-mets:sparql-load-behavior?model={{ work.uri | urlencode | replace("/", "%2F") }}"/>
<mechanism LOCTYPE="URL" LABEL="Sparql-load" xlink:href="cellar-mets:sparql-load-behavior?model={{ work.uri | urlencode | replace("/", "%2F") }}"/>
</behavior>
</behaviorSec>
</mets>
54 changes: 15 additions & 39 deletions ted_sws/notice_packager/resources/templates/mets_xml_dmd_rdf.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,38 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<cdm:work rdf:about="&resource;dataset/{{ notice.id }}">
<cdm:do_not_index rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">
{{ work.do_not_index }}
</cdm:do_not_index>
<cdm:work_date_document rdf:datatype="http://www.w3.org/2001/XMLSchema#date">
{{ work.date_document }}
</cdm:work_date_document>
<cdm:do_not_index rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">{{ work.do_not_index }}</cdm:do_not_index>
<cdm:work_date_document rdf:datatype="http://www.w3.org/2001/XMLSchema#date">{{ work.date_document }}</cdm:work_date_document>
<cdm:work_created_by_agent rdf:resource="&cellar-authority;corporate-body/{{ work.created_by_agent }}"/>
<cdm:work_dataset_published_by_agent
rdf:resource="&cellar-authority;corporate-body/{{ work.dataset_published_by_agent }}"/>
<cdm:datetime_transmission rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">
{{ work.datetime_transmission }}
</cdm:datetime_transmission>
<cdm:work_dataset_published_by_agent rdf:resource="&cellar-authority;corporate-body/{{ work.dataset_published_by_agent }}"/>
<cdm:datetime_transmission rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{{ work.datetime_transmission }}</cdm:datetime_transmission>
<cdm:datetime_negotiation rdf:resource="http://publications.europa.eu/ontology/cdm#datetime_transmission"/>

{% for lang in notice.languages %}
<cdm:work_title xml:lang="{{ lang }}">{{ work.title[lang] }}</cdm:work_title>
<cdm:work_title xml:lang="{{ lang }}">{{ work.title[lang] }}</cdm:work_title>
{% endfor %}

<cdm:work_date_creation rdf:datatype="http://www.w3.org/2001/XMLSchema#date">
{{ work.date_creation }}
</cdm:work_date_creation>
<cdm:work_date_creation rdf:datatype="http://www.w3.org/2001/XMLSchema#date">{{ work.date_creation }}</cdm:work_date_creation>
<cdm:work_id>{{ work.uri }}</cdm:work_id>
<cdm:work_dataset_version>{{ work.dataset_version }}</cdm:work_dataset_version>
<cdm:work_dataset_has_type_concept_type_dataset
rdf:resource="http://publications.europa.eu/resource/authority/dataset-type/{{ work.concept_type_dataset }}"/>

<cdm:work_dataset_has_type_concept_type_dataset rdf:resource="http://publications.europa.eu/resource/authority/dataset-type/{{ work.concept_type_dataset }}"/>
{% for dataset_keyword in work.dataset_keyword %}
<cdm:work_dataset_keyword>{{ dataset_keyword }}</cdm:work_dataset_keyword>
<cdm:work_dataset_keyword>{{ dataset_keyword }}</cdm:work_dataset_keyword>
{% endfor %}

<cdm:work_dataset_has_frequency_publication_frequency
rdf:resource="http://publications.europa.eu/resource/authority/frequency/{{ work.dataset_has_frequency_publication_frequency }}"/>
<cdm:work_dataset_has_frequency_publication_frequency rdf:resource="http://publications.europa.eu/resource/authority/frequency/{{ work.dataset_has_frequency_publication_frequency }}"/>
</cdm:work>

<cdm:expression rdf:about="&resource;expression/{{ notice.id }}">
<cdm:expression_belongs_to_work rdf:resource="&resource;dataset/{{ notice.id }}"/>

{% for lang in notice.languages %}
<cdm:expression_title xml:lang="{{ lang }}">{{ expression.title[lang] }}</cdm:expression_title>
<cdm:expression_title xml:lang="{{ lang }}">{{ expression.title[lang] }}</cdm:expression_title>
{% endfor %}

<cdm:expression_uses_language
rdf:resource="&cellar-authority;language/{{ expression.uses_language }}"/>
<cdm:expression_uses_language rdf:resource="&cellar-authority;language/{{ expression.uses_language }}"/>
</cdm:expression>

<cdm:manifestation_distribution rdf:about="&resource;distribution/{{ notice.id }}/{{ notice.id }}_rdf">
<cdm:manifestation_manifests_expression rdf:resource="&resource;expression/{{ notice.id }}"/>
<cdm:manifestation_type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
{{ manifestation.type }}
</cdm:manifestation_type>
<cdm:manifestation_date_publication rdf:datatype="http://www.w3.org/2001/XMLSchema#date">
{{ manifestation.date_publication }}
</cdm:manifestation_date_publication>
<cdm:manifestation_distribution_has_status_distribution_status
rdf:resource="http://publications.europa.eu/resource/authority/dataset-status/{{ manifestation.distribution_has_status_distribution_status }}"/>
<cdm:manifestation_distribution_has_media_type_concept_media_type
rdf:resource="http://publications.europa.eu/resource/authority/file-type/{{ manifestation.distribution_has_media_type_concept_media_type }}"/>
<cdm:manifestation_type rdf:datatype="http://www.w3.org/2001/XMLSchema#string">{{ manifestation.type }}</cdm:manifestation_type>
<cdm:manifestation_date_publication rdf:datatype="http://www.w3.org/2001/XMLSchema#date">{{ manifestation.date_publication }}</cdm:manifestation_date_publication>
<cdm:manifestation_distribution_has_status_distribution_status rdf:resource="http://publications.europa.eu/resource/authority/dataset-status/{{ manifestation.distribution_has_status_distribution_status }}"/>
<cdm:manifestation_distribution_has_media_type_concept_media_type rdf:resource="http://publications.europa.eu/resource/authority/file-type/{{ manifestation.distribution_has_media_type_concept_media_type }}"/>
</cdm:manifestation_distribution>
</rdf:RDF>
11 changes: 3 additions & 8 deletions ted_sws/notice_packager/resources/templates/tmd_rdf.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@
"/home/metaconv/metaconv_components/components/common/data/cellar_uris.ent">
%cellarEntities;
]>
<rdf:RDF xmlns:tdm="http://publications.europa.eu/ontology/tdm#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:RDF xmlns:tdm="http://publications.europa.eu/ontology/tdm#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<tdm:stream rdf:about="&resource;distribution/{{ notice.id }}/{{ notice.id }}.rdf">
<tdm:stream_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">{{ notice.id }}.rdf</tdm:stream_name>
<tdm:stream_format>
<tdm:format>
<tdm:format_designated_by_format_designation>
<tdm:format_designation>
<tdm:format_designation_format_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
{{ manifestation.type }}
</tdm:format_designation_format_name>
<tdm:format_designation_format_name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">{{ manifestation.type }}</tdm:format_designation_format_name>
</tdm:format_designation>
</tdm:format_designated_by_format_designation>
</tdm:format>
</tdm:stream_format>
<tdm:stream_label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
{{ work.title[notice.languages[0]] }}
</tdm:stream_label>
<tdm:stream_label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">{{ work.title[notice.languages[0]] }}</tdm:stream_label>
<tdm:stream_order rdf:datatype="http://www.w3.org/2001/XMLSchema#positiveInteger">1</tdm:stream_order>
</tdm:stream>
</rdf:RDF>