diff --git a/csv2rdf/index.html b/csv2rdf/index.html index c76e4290..a8deebe2 100644 --- a/csv2rdf/index.html +++ b/csv2rdf/index.html @@ -186,10 +186,7 @@

Algorithm terms

A column is defined in [[!tabular-data-model]] as a vertical arrangement of cells within a table.
common properties
-
The common properties of a metadata resource are defined in Section 3.3 Common Properties of [[!tabular-metadata]]). The RDF values of these properties are the result of running the [[!json-ld-api]] toRdf algorithm over the common properties defined within the metadata description.
- -
“Create simplified algorithm for turning normalized JSON-LD into RDF”: once that is done, the reference to the toRdf algorithm should be replaced.
- +
The common properties of a metadata resource are defined in Section 3.3 Common Properties of [[!tabular-metadata]]). The RDF triples corresponding to these properties are the result of running the algorithm specified in or equivalalent, over the common properties defined within the metadata description.
identifier
The identifier is the evaluation of the @id property for the current resource. As defined in [[!tabular-data-model]], the identifier is null if the @id property is undefined. The identifier MAY be applied to either a table group or a table.
@@ -203,6 +200,9 @@

Algorithm terms

notes
A list of notes, as defined in [[!tabular-data-model]], attached to an annotated table using the notes property. This may be an empty list.
+
prefixed name
+
A prefixed name is an abbreviation for a URI, in the syntax prefix:name. See Names of Common Properties in [[!tabular-metadata]] for information on expansion.
+
propertyUrl
The propertyUrl is the evaluation of the propertyUrl property of the current cell as defined in URI template properties in [[!tabular-metadata]].
@@ -255,8 +255,7 @@

Generating RDF

  • -

    In standard mode only, recursively insert the triples resulting from running the [[!json-ld-api]] toRdf algorithm over any common properties specified for the table group, with node G as an initial subject.

    -

    Where where language information is specified within the metadata description the appropriate language tag(s) (as defined in [[!rdf11-concepts]]) MUST be provided.

    +

    In standard mode only, emit the triples generated by running the algorithm specified in over any common properties specified for the table group, with node G as an initial subject, the common property as property, and the value of the common property as value.

  • Each table is processed sequentially in the order they are referenced in the table group description.

    @@ -289,12 +288,7 @@

    Generating RDF

  • -

    In standard mode only, recursively insert the triples resulting from running the [[!json-ld-api]] toRdf algorithm over any notes and common properties specified for the table, with node T as an initial subject.

    - -

    “Create simplified algorithm for turning normalized JSON-LD into RDF”: once that is done, the reference to the toRdf algorithm should be replaced.

    - - -

    Where where language information is specified within the metadata description for notes or common properties the appropriate language tag(s) (as defined in [[!rdf11-concepts]]) MUST be provided.

    +

    In standard mode only, emit the triples generated by running the algorithm specified in over any notes and common properties specified for the table, with node T as an initial subject, the notes or common property as property, and the value of the common property as value.

    All other annotations for the table are ignored during the conversion; including information about table schemas and column descriptions specified therein, dialect descriptions, foreign-key-definitions etc.

  • @@ -532,6 +526,68 @@

    Inclusion of provenance information

    +
    +

    JSON-LD to RDF

    +

    This section defines a mechanism for transforming the JSON-LD Dialect used for common properties and notes into RDF in a manner consistent with the Deserialize JSON-LD to RDF Algorithm defined in [[!json-ld-api]]. Converters MAY use any algorithm which results in equivalent triples.

    +

    Given a subject, property and value in normalized form:

    +
      +
    1. Property is a term defined in the [[csvw-context]], a prefixed name, or an absolute URL; expand to an absolute URL by replacing a term with the URI from the term definition in [[csvw-context]] or a prefixed name as described in .
    2. +
    3. If value is an array, generate RDF by running this algorithm using subject, property using each array member as value.
    4. +
    5. If value is an object containing @value, create an RDF Literal lit using the string value of @value and language from @language, if present, and emit the following triple: +
      +
      subject
      +
      node subject
      +
      predicate
      +
      property
      +
      object
      +
      literal node lit
      +
      +
    6. +
    7. Otherwise, if value is an object: +
        +
      1. Establish a new node S from the value of @id, if it exists, and new blank node otherwise and emit the following triple: +
        +
        subject
        +
        node subject
        +
        predicate
        +
        node property
        +
        object
        +
        node S
        +
        +
      2. +
      3. For every value of @type, either a term defined in the [[csvw-context]], a prefixed name, or an absolute URL; establish a new node Ti by expanding the value to an absolute URL by replacing a term with the URI from the term definition in [[csvw-context]] or a prefixed name with its expanded value. For each Ti, emit the following triple: +
        +
        subject
        +
        node S
        +
        predicate
        +
        rdf:type
        +
        object
        +
        node Ti
        +
        +
      4. +
      5. For every key and val from value that does not start with @ (U+0040) generate RDF by running this algorithm using S for subject, key for property and val for value. +
      6. +
      +
    8. +
    9. Otherwise, establish lit as an RDF Literal as follows: +
        +
      1. If value is true or false, create an RDF Literal lit using the strings "true" or "false", accordingly with datatype xsd:boolean
      2. +
      3. Otherwise, if value is a JSON number with a non-zero fractional part, create an RDF Literal lit using the canonical representation for value with datatype xsd:double.
      4. +
      5. Otherwise, if value is a JSON number with no non-zero fractional part, create an RDF Literal lit using the canonical representation for value with datatype xsd:integer.
      6. +
      +

      Emit the following triple: +

      +
      subject
      +
      node subject
      +
      predicate
      +
      property
      +
      object
      +
      literal node lit
      +
      +

      +
    +
    +

    Examples

    In addition to the namespaces defined above, the examples provided here make use of the following namespaces: