Skip to content

Commit cc60e17

Browse files
committed
Add some examples to README.
1 parent 13f4093 commit cc60e17

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,30 @@ Install with `gem install rdf-trix`
2323

2424
The TriX reader natively supports `xml:base` in the top-level element without the need for an XSLT. This allows values of a `uri` element to be relative URIs and resolved against that base. The base can also be specified as an option to the reader.
2525

26+
For example:
27+
28+
<TriX xmlns="http://www.w3.org/2004/03/trix/trix-1/"
29+
xml:base="http://example.org/">
30+
<graph>
31+
<uri>graph1</uri>
32+
<triple>
33+
<uri>Bob</uri>
34+
<uri>wife</uri>
35+
<uri>Mary</uri>
36+
</triple>
37+
<triple>
38+
<uri>Bob</uri>
39+
<uri>name</uri>
40+
<plainLiteral>Bob</plainLiteral>
41+
</triple>
42+
<triple>
43+
<uri>Mary</uri>
44+
<uri>age</uri>
45+
<typedLiteral datatype="http://www.w3.org/2001/XMLSchema#integer">32</typedLiteral>
46+
</triple>
47+
</graph>
48+
</TriX>
49+
2650
### RDF-star
2751

2852
Both reader and writer include provisional support for [RDF-star][].
@@ -35,6 +59,22 @@ Note that this requires the `rdfstar` option to be se.
3559

3660
**Note: This feature is subject to change or elimination as the standards process progresses.**
3761

62+
For example:
63+
64+
<TriX xmlns="http://www.w3.org/2004/03/trix/trix-1/">
65+
<graph>
66+
<triple>
67+
<triple>
68+
<uri>http://example/s1</uri>
69+
<uri>http://example/p1</uri>
70+
<uri>http://example/o1</uri>
71+
</triple>
72+
<uri>http://example/p</uri>
73+
<uri>http://example/o</uri>
74+
</triple>
75+
</graph>
76+
</TriX>
77+
3878
## Usage
3979
Instantiate a reader from a local file:
4080

@@ -53,7 +93,7 @@ Write a repository to a file:
5393
## Dependencies
5494
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1)
5595
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.10)
56-
* Soft dependency on [Nokogiri](https://rubygems.org/gems/libxml) (>= 3.0)
96+
* Soft dependency on [Libxml-Ruby](https://rubygems.org/gems/libxml-ruby) (>= 3.0)
5797

5898
## Documentation
5999

0 commit comments

Comments
 (0)