View a TAP as TXT, JSON, or YAML

The subcommand dctap read:

  • reads a CSV file - alternatively, reads CSV file contents from stdin (eg, cat example.csv | dctap read -)

  • sends a lightly normalized view of a TAP to stdout - by default, outputs TXT for on-screen debugging, without showing prefixes - with option –json, outputs JSON, with namespace prefixes - with option –yaml, outputs YAML, with namespace prefixes

The option –expand-prefixes expands any Compact IRI into a full IRI using prefixes found in the built-in defaults or as overridden by a configuration file.

The file example.csv:

shapeID

propertyID

valueNodeType

:a

dcterms:creator

IRI

can be read as TXT, with full IRIs, with dctap read –expand-prefixes example.csv:

DCTAP instance
    Shape
        shapeID                  http://example.org/a
        Statement Template
            propertyID           http://purl.org/dc/terms/creator
            valueNodeType        iri

Or as JSON with dctap read –json example.csv:

{
  "shapes": [
    {
      "shapeID": ":a",
      "statement_templates": [
        {
          "propertyID": "dcterms:creator",
          "valueNodeType": "iri"
        }
      ]
    }
  ],
  "namespaces": {
    ":": "http://example.org/",
    "dcterms:": "http://purl.org/dc/terms/"
  }
}

Or as YAML, with full IRIs, with dctap read –yaml example.csv:

shapes:
  - shapeID: :a
    statement_templates:
      - propertyID: dcterms:creator
        valueNodeType: iri
namespaces:
  ':': http://example.org/
  'dcterms:': http://purl.org/dc/terms/