-
-
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 all 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 |
---|---|---|
|
@@ -115,7 +115,8 @@ | |
</dct:references> | ||
|
||
<dct:references> | ||
<rdf:Description rdf:about="{$url}/srv/api/records/{$uuid}"> | ||
<!-- geOrchestra change: use a 'nice' HTML view for the md description url--> | ||
<rdf:Description rdf:about="{$url}/srv/fre/catalog.search#/metadata/{$uuid}"> | ||
<dct:format> | ||
<dct:IMT> | ||
<rdf:value>text/html</rdf:value> | ||
|
@@ -187,6 +188,14 @@ | |
<xsl:value-of select="(gmd:protocol/gmx:Anchor)[1]"/> | ||
</dcat:mediaType> | ||
</xsl:if> | ||
|
||
<!-- geOrchestra addition: put the description of the attached file -> fills the 'Description des données' field in uData --> | ||
<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 +282,8 @@ | |
--> | ||
<xsl:template match="gmd:MD_DataIdentification|*[contains(@gco:isoType, 'MD_DataIdentification')]" | ||
mode="to-dcat"> | ||
<dcat:Dataset rdf:about="{$resourcePrefix}/datasets/{iso19139:getResourceCode(../../.)}"> | ||
<!-- geOrchestra change: /datasets/ doesnt map to anything, use the same as rdf:Description --> | ||
<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 +300,10 @@ | |
</dct:identifier> | ||
<!-- xpath: gmd:identificationInfo/*/gmd:citation/*/gmd:identifier/*/gmd:code --> | ||
|
||
<!-- geOrchestra addition: provide an HTML record view for the 'Voir la source originale' link --> | ||
<dcat:landingPage> | ||
<xsl:value-of select="$url"/>/<xsl:value-of select="util:getNodeId()"/>/api/records/<xsl:value-of select="$uuid"/> | ||
</dcat:landingPage> | ||
|
||
<dct:title> | ||
<xsl:value-of select="gmd:citation/*/gmd:title/gco:CharacterString"/> | ||
|
@@ -427,23 +441,41 @@ | |
<!-- xpath: gmd:identificationInfo/*/gmd:language/gmd:LanguageCode/@codeListValue --> | ||
|
||
|
||
<!-- dct:license content - geOrchestra addition --> | ||
<!-- "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:accessRights> | ||
<xsl:value-of select="@codeListValue"/> | ||
</dct:accessRights> | ||
</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/??? --> | ||
|
||
|
@@ -522,6 +554,34 @@ | |
</xsl:template> | ||
|
||
|
||
<!-- geOrchestra addition | ||
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