Skip to content

Commit

Permalink
#201 Update documentation ''
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Feb 23, 2024
1 parent 3927f20 commit cbabcd5
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 37 deletions.
39 changes: 22 additions & 17 deletions docs/formats/HTML.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,18 +342,18 @@ The element names are case-sensitive when using the XML parser.
###### Input

```HTML
<html>
<head>
<title>Hello world!</title>
</head>
<body>
<p class="paragraph">Hello world</p>
</body>
</html>
<?xml version="1.0" ?>
<xx:Element xmlns:xx="http://www.example.org">
<xx:someThing>Hallo world</xx:someThing>
<xx:someThingElse xx:key="0.1"/>
</xx:Element>




```

https://sparql-anything.cc/examples/simple.html
https://sparql-anything.cc/examples/simple.xml

###### Query

Expand All @@ -363,7 +363,7 @@ CONSTRUCT
?s ?p ?o .
}
WHERE
{ SERVICE <x-sparql-anything:location=https://sparql-anything.cc/examples/simple.xml,html.parser=xml>
{ SERVICE <x-sparql-anything:location=https://sparql-anything.cc/examples/simple.xml,triplifier=io.github.sparqlanything.html.HTMLTriplifier,html.parser=xml>
{ ?s ?p ?o }
}
Expand All @@ -386,13 +386,18 @@ WHERE
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
[ rdf:type <http://www.example.org#Element> , fx:root ;
rdf:_1 [ rdf:type <http://www.example.org#someThing> ;
rdf:_1 "Hallo world"
] ;
rdf:_2 [ rdf:type <http://www.example.org#someThingElse> ;
<http://www.example.org#key> "0.1"
]
[ rdf:type <http://www.example.org#Element> , fx:root ;
rdf:_1 [ rdf:type <http://www.example.org#someThing> ;
rdf:_1 "Hallo world" ;
whatwg:innerHTML "Hallo world" ;
whatwg:innerText "Hallo world"
] ;
rdf:_2 [ rdf:type <http://www.example.org#someThingElse> ;
<http://www.example.org#key> "0.1"
] ;
xhtml:xmlns:xx "http://www.example.org" ;
whatwg:innerHTML "\n\t<xx:someThing>Hallo world</xx:someThing>\n\t<xx:someThingElse xx:key=\"0.1\" />\n" ;
whatwg:innerText "Hallo world"
] .
```
Expand Down
2 changes: 1 addition & 1 deletion docs/formats/Metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ WHERE
<http://sparql.xyz/facade-x/data/F-Number>
"f/7.1" ;
<http://sparql.xyz/facade-x/data/File%20Modified%20Date>
"Fri Feb 23 15:47:25 +00:00 2024" ;
"Fri Feb 23 15:53:44 +00:00 2024" ;
<http://sparql.xyz/facade-x/data/File%20Name>
"Canon_40D.jpg" ;
<http://sparql.xyz/facade-x/data/File%20Size>
Expand Down
39 changes: 22 additions & 17 deletions formats/HTML.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,18 +342,18 @@ The element names are case-sensitive when using the XML parser.
###### Input

```HTML
<html>
<head>
<title>Hello world!</title>
</head>
<body>
<p class="paragraph">Hello world</p>
</body>
</html>
<?xml version="1.0" ?>
<xx:Element xmlns:xx="http://www.example.org">
<xx:someThing>Hallo world</xx:someThing>
<xx:someThingElse xx:key="0.1"/>
</xx:Element>




```

https://sparql-anything.cc/examples/simple.html
https://sparql-anything.cc/examples/simple.xml

###### Query

Expand All @@ -363,7 +363,7 @@ CONSTRUCT
?s ?p ?o .
}
WHERE
{ SERVICE <x-sparql-anything:location=https://sparql-anything.cc/examples/simple.xml,html.parser=xml>
{ SERVICE <x-sparql-anything:location=https://sparql-anything.cc/examples/simple.xml,triplifier=io.github.sparqlanything.html.HTMLTriplifier,html.parser=xml>
{ ?s ?p ?o }
}
Expand All @@ -386,13 +386,18 @@ WHERE
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix xyz: <http://sparql.xyz/facade-x/data/> .
[ rdf:type <http://www.example.org#Element> , fx:root ;
rdf:_1 [ rdf:type <http://www.example.org#someThing> ;
rdf:_1 "Hallo world"
] ;
rdf:_2 [ rdf:type <http://www.example.org#someThingElse> ;
<http://www.example.org#key> "0.1"
]
[ rdf:type <http://www.example.org#Element> , fx:root ;
rdf:_1 [ rdf:type <http://www.example.org#someThing> ;
rdf:_1 "Hallo world" ;
whatwg:innerHTML "Hallo world" ;
whatwg:innerText "Hallo world"
] ;
rdf:_2 [ rdf:type <http://www.example.org#someThingElse> ;
<http://www.example.org#key> "0.1"
] ;
xhtml:xmlns:xx "http://www.example.org" ;
whatwg:innerHTML "\n\t<xx:someThing>Hallo world</xx:someThing>\n\t<xx:someThingElse xx:key=\"0.1\" />\n" ;
whatwg:innerText "Hallo world"
] .
```
Expand Down
2 changes: 1 addition & 1 deletion formats/Metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ WHERE
<http://sparql.xyz/facade-x/data/F-Number>
"f/7.1" ;
<http://sparql.xyz/facade-x/data/File%20Modified%20Date>
"Fri Feb 23 15:47:25 +00:00 2024" ;
"Fri Feb 23 15:53:44 +00:00 2024" ;
<http://sparql.xyz/facade-x/data/File%20Name>
"Canon_40D.jpg" ;
<http://sparql.xyz/facade-x/data/File%20Size>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class HTMLTriplifier implements Triplifier {
@Option(description = "It tells the triplifier to use the specified browser to navigate to the page to obtain HTML. By default a browser is not used. The use of a browser has some dependencies -- see [BROWSER](https://github.com/SPARQL-Anything/sparql.anything/blob/v1.0-DEV/BROWSER.md) and [justin2004's blogpost](https://github.com/justin2004/weblog/tree/master/scraping_with_sparql).", validValues = "chromium|webkit|firefox")
public static final IRIArgument PROPERTY_BROWSER = new IRIArgument("html.browser");

@Example(resource = "https://sparql-anything.cc/examples/simple.html", description = "The element names are case-sensitive when using the XML parser.", query = "CONSTRUCT {?s ?p ?o} WHERE { SERVICE <x-sparql-anything:location=https://sparql-anything.cc/examples/simple.xml,html.parser=xml> { ?s ?p ?o } }")
@Example(resource = "https://sparql-anything.cc/examples/simple.xml", description = "The element names are case-sensitive when using the XML parser.", query = "CONSTRUCT {?s ?p ?o} WHERE { SERVICE <x-sparql-anything:location=https://sparql-anything.cc/examples/simple.xml,triplifier=io.github.sparqlanything.html.HTMLTriplifier,html.parser=xml> { ?s ?p ?o } }")
@Option(description = "It tells the triplifier to use the specified JSoup parser (default: html).", validValues = "xml html")
public static final IRIArgument PROPERTY_PARSER = new IRIArgument("html.parser", "html");
private enum ParamParser {
Expand Down

0 comments on commit cbabcd5

Please sign in to comment.