Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Change management processing by downstream users



...

Change document specification approaches

rdflib

Reference: https://rdrr.io/cran/rdflib/man/rdflib-package.html

This is an R package used to manipulate triples.  Worth looking at how it specifies changes.

  • add - rdf_add - could be used to express adding a triple
  • delete - do not see a spec for removing a triple

rdf_add

Reference: https://rdrr.io/cran/rdflib/man/rdf_add.html

rdf_add could be used to specify adding a triple.

Example:

Code Block
languagenone
rdf <- rdf()
rdf_add(rdf, 
    subject="http://www.dajobe.org/",
    predicate="http://purl.org/dc/elements/1.1/language",
    object="en")
    
## non-URI string in subject indicates a blank subject
## (prefixes to "_:b0")
rdf_add(rdf, "b0", "http://schema.org/jobTitle", "Professor") 

## identically a blank subject.  
## Note rdf is unchanged when we add the same triple twice.
rdf_add(rdf, "b0", "http://schema.org/jobTitle", "Professor", 
        subjectType = "blank") 
        
## blank node with empty string creates a default blank node id
rdf_add(rdf, "", "http://schema.org/jobTitle", "Professor")   
                    

## Subject and Object both recognized as URI resources:
rdf_add(rdf, 
        "https://orcid.org/0000-0002-1642-628X",
        "http://schema.org/homepage", 
        "http://carlboettiger.info")  

 ## Force object to be literal, not URI resource        
rdf_add(rdf, 
        "https://orcid.org/0000-0002-1642-628X",
        "http://schema.org/homepage", 
        "http://carlboettiger.info",
        objectType = "literal")