Skip to content

Commit

Permalink
Update documentation #201
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Nov 20, 2023
1 parent c80d488 commit 7a1010c
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 35 deletions.
66 changes: 33 additions & 33 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ It is mandatory to provide either `location`, `content`, or `command`.

##### UC1: Retrieving from https://sparql-anything.cc/example1.json the names of the TV Series starring Courtney Cox.

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
Expand All @@ -137,7 +137,7 @@ Result

##### UC2: Retrieving from /absolute/path/to/example1.json the names of the TV Series starring Courtney Cox.

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
Expand All @@ -160,7 +160,7 @@ Result

##### UC2: Retrieving from relative/path/to/example1.json the names of the TV Series starring Courtney Cox.

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
Expand Down Expand Up @@ -199,7 +199,7 @@ It is mandatory to provide either `location`, `content`, or `command`.

##### UC1: Count the number of items in the words in "one,two,three"

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
SELECT (count(*) AS ?c)
Expand All @@ -226,7 +226,7 @@ Result

##### UC2: Count the number of items in the JSON Array `["one","two","three"]`

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
SELECT (count(*) AS ?c)
Expand Down Expand Up @@ -273,7 +273,7 @@ It is mandatory to provide either `location`, `content`, or `command`.

##### UC1: Count the number of items in the JSON Array generated by the command `echo "[\"one\",\"two\",\"three\", \"four\"]"`

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
SELECT (COUNT(?o) AS ?nOfItems)
Expand Down Expand Up @@ -317,7 +317,7 @@ See also [Archive](formats/Archive.md)

###### Query

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand Down Expand Up @@ -408,7 +408,7 @@ location + '#' (in the case of location argument set) <br/> **or** <br/> 'http:

##### UC1: Set the root of the Facade-X model generated from the JSON Object {"name":"Vincent", "surname": "Vega"} as http://example.org/myRoot

```
```sparql
CONSTRUCT
{
?s ?p ?o .
Expand All @@ -427,7 +427,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
<http://example.org/myRoot>
Expand All @@ -440,7 +440,7 @@ Result

##### UC2: Set the root of the Facade-X model generated from the string "Hello World!" as http://example.org/myRoot

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
CONSTRUCT
Expand All @@ -460,7 +460,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
<http://example.org/myRoot> a fx:root ;
Expand All @@ -486,7 +486,7 @@ No value (the media-type will be guessed from the file extension).
##### UC1: Enforcing media-type for content string to count the number of elements in the JSON Array ["one", "two", "three", "four"]


```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
SELECT (count(*) AS ?c)
Expand Down Expand Up @@ -526,7 +526,7 @@ http://sparql.xyz/facade-x/data/

##### UC1: Set the namespace prefix to http://example.org/myNamespace/ for the properties generated from the JSON Object {"name":"Vincent", "surname": "Vega"}

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
Expand All @@ -548,7 +548,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
[ a fx:root ;
Expand All @@ -575,7 +575,7 @@ true

##### UC1: Transform the JSON Object {"name":"Vincent", "surname": "Vega", "performer" : {"name": "John", "surname": "Travolta"} } into RDF without using blank nodes

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
CONSTRUCT
Expand All @@ -595,7 +595,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
Expand Down Expand Up @@ -674,7 +674,7 @@ No value

##### UC1: Transform the JSON Object {"name":"Vincent", "surname": "Vega", "ID": "myNull", "performer" : {"name": "John", "surname": "Travolta"} } and consider the string "myNull" as null

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
CONSTRUCT
Expand All @@ -694,7 +694,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
Expand Down Expand Up @@ -723,7 +723,7 @@ No value

##### UC1: Transform the JSON Object {"name":"Vincent", "surname": "Vega"" } (provided as a content string)into RDF by using the JSON Triplifier

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
CONSTRUCT
Expand All @@ -742,7 +742,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
Expand All @@ -768,7 +768,7 @@ UTF-8

##### UC1: Triplify the UTF-16 file located at https://sparql-anything.cc/examples/utf16.txt

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
CONSTRUCT
Expand All @@ -787,7 +787,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
Expand All @@ -814,7 +814,7 @@ No value
##### UC1: Use on disk graph for triplifying the JSON Object {"name":"Vincent", "surname": "Vega" } (provided as a content string).


```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
CONSTRUCT
Expand All @@ -834,7 +834,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
Expand All @@ -860,7 +860,7 @@ true

##### UC1:

```
```sparql
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
CONSTRUCT
Expand All @@ -882,7 +882,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
Expand Down Expand Up @@ -910,7 +910,7 @@ The execution strategy. 0 = in memory, all triples; 1 = in memory, only triples

##### UC1: Retrieving from relative/path/to/example1.json the names of the TV Series starring Courtney Cox.

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
Expand Down Expand Up @@ -950,7 +950,7 @@ false

##### UC1: Retrieving name and surname of the actors in https://sparql-anything.cc/examples/simpleArray.json along with the movie they performed in.

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand Down Expand Up @@ -981,7 +981,7 @@ Result



```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand Down Expand Up @@ -1028,7 +1028,7 @@ false

##### UC1: Using rdfs:member instead of container membership properties for triplifying the JSON Array [1,2,3]

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand All @@ -1050,7 +1050,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
Expand Down Expand Up @@ -1079,7 +1079,7 @@ false

##### UC1: Using rdfs:member instead of container membership properties for triplifying the JSON Array [1,2,3], but keeping the ordinal number of the slots

```
```sparql
PREFIX xyz: <http://sparql.xyz/facade-x/data/>
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand All @@ -1102,7 +1102,7 @@ WHERE

Result

```
```turtle
@prefix fx: <http://sparql.xyz/facade-x/ns/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Main features:
- Provides a homogenous view over heterogeneous data sources, thanks to the Facade-X meta-model (see [Facade-X specification](Facade-X.md) )
- Query files in plain SPARQL 1.1, via the `SERVICE <x-sparql-anything:>` (see [configuration](#Configuration)) and
build knowledge graphs with `CONSTRUCT` queries
- [Supported formats](#supported-formats): XML, JSON, CSV, HTML, Excel, Text, SVG, Binary, EXIF, File System, Zip/Tar,
- [Supported formats](#supported-formats): XML, JSON, CSV, HTML, Excel, Text, Binary, EXIF, File System, Zip/Tar,
Markdown, YAML, Bibtex, DOCx (see [pages dedicated to single formats](#supported-formats))
- Transforms [files, inline content, or the output of an external command](#general-purpose-options)
- Generates RDF, RDF-Star, and tabular data (thanks to SPARQL)
Expand Down
9 changes: 8 additions & 1 deletion docs/formats/XML.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ SPARQL Anything reuses namespaces declared within the original document to name
SPARQL Anything selects this transformer for the following file extensions:

- .xml
- .svg

## Media types

Expand Down Expand Up @@ -337,4 +338,10 @@ WHERE
<http://sparql.xyz/facade-x/data/isbn>
"432-3-16-143110-1" .
```
```
### SVG

For SVG, the media type should be "application/xml":
```sparql
fx:properties fx:media-type "application/xml" .
```
22 changes: 22 additions & 0 deletions docs/formats/YAML.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,29 @@ WHERE
] .
```

## Options

### Summary

| Option name | Description | Valid Values | Default Value |
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------|--------------|---------------|
| yaml.allow-duplicate-keys | Yaml 1.2 forbids duplicate keys, raising an error (default behaviour). When true, duplicate keys are tolerated (last wins). | true,false | false |

---

### `yaml.allow-duplicate-keys`

#### Description

A CSS selector that restricts the HTML tags to consider for the triplification.

#### Valid Values

Any valid CSS selector.

#### Default Value

No value

<!--
#
Expand Down

0 comments on commit 7a1010c

Please sign in to comment.