Skip to content

Template

AtesComp edited this page Apr 3, 2022 · 4 revisions

RDF Transform Template

The structure of the RDF Transform template is stored in a uniform JSON format.

Structure

The following example illustrates the template.

{
   "baseIRI" : "some://Example/",
   "extension" : "RDFTransform",
   "namespaces" : {
      "foaf" : "http://xmlns.com/foaf/0.1/",
      "myp" : "some://Example/namespace/",
      "owl" : "http://www.w3.org/2002/07/owl#",
      "rdf" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
      "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
      "xsd" : "http://www.w3.org/2001/XMLSchema#",
      "vcard" : "http://www.w3.org/2006/vcard/ns#"
   },
   "subjectMappings" : [
      {
         "expression" : {
            "code" : "toIRIString(row.record.index)",
            "language" : "grel"
         },
         "prefix" : "myp",
         "propertyMappings" : [
            {
               "objectMappings" : [
                  {
                     "expression" : {
                        "code" : "toIRIString(toStrippedLiteral(value))",
                        "language" : "grel"
                     },
                     "prefix" : "myp",
                     "valueSource" : {
                        "columnName" : "name/family",
                        "source" : "column"
                     },
                     "valueType" : {
                        "type" : "iri"
                     }
                  }
               ],
               "prefix" : "myp",
               "valueSource" : {
                  "constant" : "familyName",
                  "source" : "constant"
               }
            },
            {
               "objectMappings" : [
                  {
                     "valueSource" : {
                        "columnName" : "timestamp",
                        "source" : "column"
                     },
                     "valueType" : {
                        "datatype" : {
                           "prefix" : "xsd",
                           "valueSource" : {
                              "constant" : "dateTime",
                              "source" : "constant"
                           }
                        },
                        "type" : "datatype_literal"
                     }
                  }
               ],
               "prefix" : "myp",
               "valueSource" : {
                  "constant" : "collectedOn",
                  "source" : "constant"
               }
            },
            {
               "objectMappings" : [
                  {
                     "valueSource" : {
                        "columnName" : "notes/comments",
                        "source" : "column"
                     },
                     "valueType" : {
                        "language" : "en",
                        "type" : "language_literal"
                     }
                  }
               ],
               "prefix" : "mpy",
               "valueSource" : {
                  "constant" : "notes",
                  "source" : "constant"
               }
            }
         ],
         "typeMappings" : [
            {
               "prefix" : "myp",
               "valueSource" : {
                  "constant" : "Classy",
                  "source" : "constant"
               }
            }
         ],
         "valueSource" : {
            "source" : "record_id"
         }
      }
   ],
   "version" : "2.0.0"
}

Design Details

Clone this wiki locally