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

Add a 'Pass Through URI' Data Converter to JSON-LD #1581

Closed
seth-shaw-unlv opened this issue Aug 12, 2020 · 1 comment
Closed

Add a 'Pass Through URI' Data Converter to JSON-LD #1581

seth-shaw-unlv opened this issue Aug 12, 2020 · 1 comment

Comments

@seth-shaw-unlv
Copy link
Contributor

At times when creating our JSON-LD for a repository object we have entity reference fields where we don't want the targeted taxonomy term, we want the value stored in a term's field. Examples include rights statements URIs (see @elizoller 's comment), genre terms, or subjects where we would rather our RDF refer to the external URI rather than our internal one.

Instead of

{
   "@graph":[
      {
         "@id":"http://localhost:8000/node/2",
         "@type":[
            "http://pcdm.org/models#Object",
            "http://purl.org/coar/resource_type/c_c513"
         ],
         "http://purl.org/dc/terms/title":[
            {
               "@value":"Item 2",
               "@language":"en"
            }
         ],
         "http://purl.org/dc/terms/rights":[
            {
               "@id":"http://localhost:8000/term/34",
            }
         ],
         "http://schema.org/sameAs":[
            {
               "@id":"http://localhost:8000/node/2"
            }
         ]
      },
      {
         "@id":"http://localhost:8000/term/34",
         "@type":[
            "http://purl.org/dc/terms/RightsStatement"
         ]
      }
   ]
}

which would then have a 'sameAs' (or close match, whatever the predicate is...) jump over to the actual rights statement URI, we could have the simpler:

{
   "@graph":[
      {
         "@id":"http://localhost:8000/node/2",
         "@type":[
            "http://pcdm.org/models#Object",
            "http://purl.org/coar/resource_type/c_c513"
         ],
         "http://purl.org/dc/terms/title":[
            {
               "@value":"Item 2",
               "@language":"en"
            }
         ],
         "http://purl.org/dc/terms/rights":[
            {
               "@id":"http://rightsstatements.org/vocab/InC-NC/1.0/"
            }
         ],
         "http://schema.org/sameAs":[
            {
               "@id":"http://localhost:8000/node/2"
            }
         ]
      }
   ]
}

I'm working on a PR that adds a Data Converter class that allows us to use the rdf mapping config to specify what field in the target should be used for the transformation as well as refactors the EntityReferenceItemNormalizer to allow for this case. I just need to clean it up a bit and hopefully add a test or two before I submit it.

@dannylamb
Copy link
Contributor

Resolved via Islandora/jsonld@659ef35

elizoller added a commit that referenced this issue Aug 20, 2020
Add documentation for change made in: #1581
@seth-shaw-unlv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants