This program is a utility to transform CSV files into RDF files. It has 2 modes:
$ csv2rdf -o [OPTIONS.ini] [-v]
Options:
[./tests/test1.csv]
domain = https://www.example.com/rdf/design#
type = ConfigurationItem
predicate_prefix = CI_
delimiter = ;
[./tests/test2.csv]
domain = https://www.example.com/rdf/design#
type = ConfigurationItem
predicate_prefix = CI_
delimiter = ;
semantics = ./tests/semantics.csv
Vocabulary hypothesis: triples are decomposed in subject, predicate, object. Subjects and objects are roles that can be endorsed by URIRefs or Literal or blank nodes.
Despite the fact that there may be lists in some fields, we'll try not to use any blank node concept.
Here is a sample of interpretation that wa can have reading a CSV file.
The table is containing lines of ConceptName
:
1. Li a ConceptName .
Depending on the value in the cell, if the value is an object:
2. Cij a Kj .
3. Cij Kj Li .
or
3. Li Kj Cij .
If the value oi the cell is a web semantic value:
3. Li kJ Cij .
(Cij does not have a type).
The semantic parser works with a semantic simplistic grammar. The idea of this grammar is to identify how the 3 following informations should be dealt with:
subject1
. subject1
will be potentially used for triple generations when treating the rest of the cells.subject1
or not.The grammar proposes the following semantic:
colum-name;command
_
by the parser (in case the column name has spaces in it)role|type|direction|name
OR ignore
, separator is |
subject1
for the primary subjectsubject2
for others
subject2
is here to flag the cell as a subject or object. The fact that subject2
be a subject or object is determine by the direction.S
for standard (meaning subject1 predicate object
)R
for reverse (meaning object predicate subject1
)Examples:
Note: the parser eliminates UTF8 errors.
See also: