-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
wip for better csw-dcat output for data.gouv.fr #288
Draft
landryb
wants to merge
5
commits into
georchestra:georchestra-gn4.2.x
Choose a base branch
from
landryb:wip/csw-dcat
base: georchestra-gn4.2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c5d84f1
wip for better csw-dcat output for data.gouv.fr, from @jeanpommier (#…
landryb 24cf7af
create a link that resolves to a md page for landingPage
landryb 24105e2
use util:getNodeId instead of hardcoding srv in dcat:landingPage
landryb d0e5f1b
cleanup after discussion with @jeanpommier
landryb 2a26e62
we shouldnt have two dct:licence blocks
landryb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,7 @@ | |
<xsl:param name="uuid"/> | ||
|
||
<dct:references> | ||
<!-- SIB addon--> | ||
<rdf:Description rdf:about="{$url}/srv/api/records/{$uuid}/formatters/xml"> | ||
<dct:format> | ||
<dct:IMT> | ||
|
@@ -115,7 +116,9 @@ | |
</dct:references> | ||
|
||
<dct:references> | ||
<rdf:Description rdf:about="{$url}/srv/api/records/{$uuid}"> | ||
<!-- SIB addon--> | ||
<!-- <rdf:Description rdf:about="{$url}/srv/api/records/{$uuid}"> --> | ||
<rdf:Description rdf:about="{$url}/srv/fre/catalog.search#/metadata/{$uuid}"> | ||
<dct:format> | ||
<dct:IMT> | ||
<rdf:value>text/html</rdf:value> | ||
|
@@ -187,6 +190,14 @@ | |
<xsl:value-of select="(gmd:protocol/gmx:Anchor)[1]"/> | ||
</dcat:mediaType> | ||
</xsl:if> | ||
|
||
<!-- SIB addon--> | ||
<xsl:if test="(gmd:description/gco:CharacterString)[1]!=''"> | ||
<dct:description> | ||
<xsl:value-of select="(gmd:description/gco:CharacterString)[1]"/> | ||
</dct:description> | ||
</xsl:if> | ||
|
||
<xsl:if test="(gmd:protocol/gco:CharacterString)[1]!=''"> | ||
<dct:format> | ||
<xsl:value-of select="(gmd:protocol/gco:CharacterString)[1]"/> | ||
|
@@ -273,7 +284,10 @@ | |
--> | ||
<xsl:template match="gmd:MD_DataIdentification|*[contains(@gco:isoType, 'MD_DataIdentification')]" | ||
mode="to-dcat"> | ||
<dcat:Dataset rdf:about="{$resourcePrefix}/datasets/{iso19139:getResourceCode(../../.)}"> | ||
|
||
<!-- SIB addon--> | ||
<!-- <dcat:Dataset rdf:about="{$resourcePrefix}/datasets/{iso19139:getResourceCode(../../.)}"> --> | ||
<dcat:Dataset rdf:about="{$resourcePrefix}/{iso19139:getResourceCode(../../.)}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<xsl:call-template name="to-dcat"/> | ||
</dcat:Dataset> | ||
</xsl:template> | ||
|
@@ -290,6 +304,10 @@ | |
</dct:identifier> | ||
<!-- xpath: gmd:identificationInfo/*/gmd:citation/*/gmd:identifier/*/gmd:code --> | ||
|
||
<!-- SIB addon--> | ||
<dcat:landingPage> | ||
<xsl:value-of select="$url"/>/srv/api/records/<xsl:value-of select="$uuid"/> | ||
landryb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</dcat:landingPage> | ||
|
||
<dct:title> | ||
<xsl:value-of select="gmd:citation/*/gmd:title/gco:CharacterString"/> | ||
|
@@ -299,6 +317,16 @@ | |
|
||
<dct:abstract> | ||
<xsl:value-of select="gmd:abstract/gco:CharacterString"/> | ||
|
||
<!-- SIB addon--> | ||
<!-- Layout will be visible only in source mode in the browser. If not in source mode, newlines won't be displayed and the keywords will be shown inline --> | ||
<xsl:text>
</xsl:text> <!-- linebreak --> | ||
<!-- Keywords --> | ||
<xsl:for-each-group select="//gmd:MD_Keywords[(gmd:thesaurusName)]/gmd:keyword" | ||
group-by="gco:CharacterString|gmx:Anchor"> | ||
<xsl:text>
</xsl:text> <!-- linebreak --> | ||
<xsl:value-of select="normalize-space(../gmd:thesaurusName/*/gmd:title)"/> : <xsl:value-of select="normalize-space(gco:CharacterString|gmx:Anchor)"/><xsl:text>.</xsl:text> | ||
</xsl:for-each-group> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after discussion with @jeanpommier this section might not be needed ? |
||
</dct:abstract> | ||
<!-- xpath: gmd:identificationInfo/*/gmd:abstract/gco:CharacterString --> | ||
|
||
|
@@ -427,26 +455,45 @@ | |
<!-- xpath: gmd:identificationInfo/*/gmd:language/gmd:LanguageCode/@codeListValue --> | ||
|
||
|
||
<!-- dct:license content --> | ||
<!-- "The license under which the dataset is published and can be reused." --> | ||
<xsl:for-each select="gmd:resourceConstraints/gmd:MD_LegalConstraints/*/gmd:MD_RestrictionCode[@codeListValue!='otherRestrictions']"> | ||
<dct:license> | ||
<xsl:value-of select="@codeListValue"/> | ||
</dct:license> | ||
<xsl:for-each select="gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:useConstraints"> | ||
<xsl:choose> | ||
<xsl:when test="gmd:MD_RestrictionCode[@codeListValue!='otherRestrictions']"> | ||
<dct:license> | ||
<xsl:value-of select="@codeListValue"/> | ||
</dct:license> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:call-template name="legalOtherConstraints"> | ||
<xsl:with-param name="ocnode"><xsl:copy-of select="./following-sibling::gmd:otherConstraints[1]"/></xsl:with-param> | ||
<xsl:with-param name="tagname">license</xsl:with-param> | ||
</xsl:call-template> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:for-each> | ||
<xsl:for-each | ||
select="gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gco:CharacterString"> | ||
<dct:license> | ||
<xsl:value-of select="."/> | ||
</dct:license> | ||
</xsl:for-each> | ||
<xsl:for-each | ||
select="gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gmx:Anchor"> | ||
<dct:license rdf:resource="{@xlink:href}"> | ||
<xsl:value-of select="."/> | ||
</dct:license> | ||
|
||
<!-- Access constraints should not be stored under license, but rather on accessRights category, | ||
cf https://semiceu.github.io/GeoDCAT-AP/releases/2.0.0/#conditions-for-access-and-use-and-limitations-on-public-access-use-limitation-and-access-other-constraints | ||
--> | ||
<xsl:for-each select="gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints"> | ||
<xsl:choose> | ||
<xsl:when test="gmd:MD_RestrictionCode[@codeListValue!='otherRestrictions']"> | ||
<dct:license> | ||
<xsl:value-of select="@codeListValue"/> | ||
</dct:license> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:call-template name="legalOtherConstraints"> | ||
<xsl:with-param name="ocnode"><xsl:copy-of select="./following-sibling::gmd:otherConstraints[1]"/></xsl:with-param> | ||
<xsl:with-param name="tagname">accessRights</xsl:with-param> | ||
</xsl:call-template> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:for-each> | ||
<!-- xpath: gmd:identificationInfo/*/gmd:resourceConstraints/??? --> | ||
|
||
|
||
<xsl:for-each select="../../gmd:distributionInfo/*/gmd:transferOptions/*/gmd:onLine"> | ||
<dcat:distribution rdf:resource="{iso19139:RecordUri($uuid)}#{encode-for-uri(gmd:CI_OnlineResource/gmd:protocol/*/text())}-{encode-for-uri(gmd:CI_OnlineResource/gmd:name/(gco:CharacterString|gmx:Anchor)/text())}"/> | ||
</xsl:for-each> | ||
|
@@ -522,6 +569,34 @@ | |
</xsl:template> | ||
|
||
|
||
<!-- | ||
Process the otherContraints in LegalResources differently depending on the previous sibling. If gmd:useConstraints use dct:license, if gmd:accessConstraints use dct:accessRights | ||
--> | ||
<xsl:template name="legalOtherConstraints"> | ||
<xsl:param name="ocnode"/> | ||
<xsl:param name="tagname"/> | ||
|
||
<xsl:choose> | ||
<xsl:when test="$ocnode/gmd:otherConstraints/gmx:Anchor"> | ||
<xsl:element name="dct:{$tagname}"> | ||
<xsl:attribute name="rdf:resource"> | ||
<xsl:value-of select="$ocnode/gmd:otherConstraints/gmx:Anchor/@xlink:href"/> | ||
</xsl:attribute> | ||
<xsl:value-of select="$ocnode/gmd:otherConstraints/gmx:Anchor"/> | ||
</xsl:element> | ||
</xsl:when> | ||
<xsl:when test="$ocnode/gmd:otherConstraints/gco:CharacterString"> | ||
<xsl:element name="dct:{$tagname}"> | ||
<xsl:value-of select="$ocnode/gmd:otherConstraints/gco:CharacterString"/> | ||
</xsl:element> | ||
</xsl:when> | ||
<!-- <xsl:otherwise>--> | ||
<!-- <xsl:copy-of select="$ocnode"/>--> | ||
<!-- </xsl:otherwise>--> | ||
</xsl:choose> | ||
</xsl:template> | ||
|
||
|
||
<!-- | ||
Get resource (dataset or service) identifier if set and return metadata UUID if not. | ||
--> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for $self: this is to solve
Description des données non renseignée
on harvested data, which comes from the attached resource description