@@ -44,23 +44,8 @@ linkml-convert -s personinfo.yaml -t rdf data.yaml
4444
4545Outputs:
4646
47- ``` turtle
48- @prefix ORCID: <https://orcid.org/> .
49- @prefix personinfo: <https://w3id.org/linkml/examples/personinfo/> .
50- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
51-
52- ORCID:1234 a personinfo:Person ;
53- personinfo:age 33 ;
54- personinfo:full_name "Clark Kent" ;
55- personinfo:phone "555-555-5555" .
56-
57- ORCID:4567 a personinfo:Person ;
58- personinfo:age 34 ;
59- personinfo:full_name "Lois Lane" .
60-
61- [] a personinfo:Container ;
62- personinfo:persons ORCID:1234,
63- ORCID:4567 .
47+ ``` {literalinclude} ../../examples/tutorial/tutorial04/data.ttl
48+ :language: turtle
6449```
6550
6651Note that each person is now represented by an ORCID URI. This is a
@@ -90,25 +75,8 @@ linkml-convert -s personinfo-semantic.yaml -t rdf data.yaml
9075
9176Outputs:
9277
93- ``` turtle
94- @prefix ORCID: <https://orcid.org/> .
95- @prefix personinfo: <https://w3id.org/linkml/examples/personinfo/> .
96- @prefix schema1: <http://schema.org/> .
97- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
98-
99- ORCID:1234 a schema1:Person ;
100- schema1:name "Clark Kent" ;
101- schema1:telephone "555-555-5555" ;
102- personinfo:age 33 .
103-
104- ORCID:4567 a schema1:Person ;
105- schema1:name "Lois Lane" ;
106- personinfo:age 34 .
107-
108- [] a personinfo:Container ;
109- personinfo:persons ORCID:1234,
110- ORCID:4567 .
111-
78+ ``` {literalinclude} ../../examples/tutorial/tutorial04/data-semantic.ttl
79+ :language: turtle
11280```
11381
11482Note that the prefixes are hidden but the effect is to reuse URIs such as [ schema: telephone ] ( http://schema.org/telephone )
@@ -127,41 +95,8 @@ gen-jsonld-context --no-metadata personinfo-semantic.yaml
12795
12896Outputs:
12997
130- ``` json
131- {
132- "@context" : {
133- "xsd" : " http://www.w3.org/2001/XMLSchema#" ,
134- "ORCID" : " https://orcid.org/" ,
135- "linkml" : " https://w3id.org/linkml/" ,
136- "personinfo" : " https://w3id.org/linkml/examples/personinfo/" ,
137- "schema" : " http://schema.org/" ,
138- "@vocab" : " https://w3id.org/linkml/examples/personinfo/" ,
139- "persons" : {
140- "@type" : " schema:Person" ,
141- "@id" : " persons"
142- },
143- "age" : {
144- "@type" : " xsd:integer" ,
145- "@id" : " age"
146- },
147- "aliases" : {
148- "@id" : " aliases"
149- },
150- "full_name" : {
151- "@id" : " schema:name"
152- },
153- "id" : " @id" ,
154- "phone" : {
155- "@id" : " schema:telephone"
156- },
157- "Container" : {
158- "@id" : " Container"
159- },
160- "Person" : {
161- "@id" : " schema:Person"
162- }
163- }
164- }
98+ ``` {literalinclude} ../../examples/tutorial/tutorial04/personinfo-semantic.context.jsonld
99+ : language: json
165100```
166101
167102NOTE: currently you need to declare your own type object and map this to ` rdf:type ` for typing information to be shown
@@ -177,68 +112,8 @@ gen-shex --no-metadata personinfo-semantic.yaml
177112
178113Outputs:
179114
180- ``` shex
181- # metamodel_version: 1.7.0
182- BASE <https://w3id.org/linkml/examples/personinfo/>
183- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
184- PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
185- PREFIX linkml: <https://w3id.org/linkml/>
186- PREFIX schema1: <http://schema.org/>
187-
188-
189- linkml:String xsd:string
190-
191- linkml:Integer xsd:integer
192-
193- linkml:Boolean xsd:boolean
194-
195- linkml:Float xsd:float
196-
197- linkml:Double xsd:double
198-
199- linkml:Decimal xsd:decimal
200-
201- linkml:Time xsd:time
202-
203- linkml:Date xsd:date
204-
205- linkml:Datetime xsd:dateTime
206-
207- linkml:DateOrDatetime linkml:DateOrDatetime
208-
209- linkml:Uriorcurie IRI
210-
211- linkml:Curie xsd:string
212-
213- linkml:Uri IRI
214-
215- linkml:Ncname xsd:string
216-
217- linkml:Objectidentifier IRI
218-
219- linkml:Nodeidentifier NONLITERAL
220-
221- linkml:Jsonpointer xsd:string
222-
223- linkml:Jsonpath xsd:string
224-
225- linkml:Sparqlpath xsd:string
226-
227- <Container> CLOSED {
228- ( $<Container_tes> <persons> @<Person> * ;
229- rdf:type [ <Container> ] ?
230- )
231- }
232-
233- <Person> CLOSED {
234- ( $<Person_tes> ( schema1:name @linkml:String ;
235- <aliases> @linkml:String * ;
236- schema1:telephone @linkml:String ? ;
237- <age> @linkml:Integer ?
238- ) ;
239- rdf:type [ schema1:Person ]
240- )
241- }
115+ ``` {literalinclude} ../../examples/tutorial/tutorial04/personinfo-semantic.shex
116+ :language: shex
242117```
243118
244119
@@ -250,46 +125,8 @@ Outputs:
250125
251126<!-- compare_rdf -->
252127<!-- NOTE: the order of properties is non-deterministic so we cannot compare string directly>
253- ```turtle
254- @prefix personinfo: <https://w3id.org/linkml/examples/personinfo/> .
255- @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
256- @prefix schema1: <http://schema.org/> .
257- @prefix sh: <http://www.w3.org/ns/shacl#> .
258- @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
259-
260- personinfo:Container a sh:NodeShape ;
261- sh:closed true ;
262- sh:ignoredProperties ( rdf:type ) ;
263- sh:property [ sh:class schema1:Person ;
264- sh:nodeKind sh:IRI ;
265- sh:order 0 ;
266- sh:path personinfo:persons ] ;
267- sh:targetClass personinfo:Container .
268-
269- schema1:Person a sh:NodeShape ;
270- sh:closed true ;
271- sh:ignoredProperties ( rdf:type ) ;
272- sh:property [ sh:maxCount 1 ;
273- sh:maxInclusive 200 ;
274- sh:minInclusive 0 ;
275- sh:order 4 ;
276- sh:path personinfo:age ],
277- [ sh:description "name of the person" ;
278- sh:maxCount 1 ;
279- sh:minCount 1 ;
280- sh:order 1 ;
281- sh:path schema1:name ],
282- [ sh:maxCount 1 ;
283- sh:order 0 ;
284- sh:path personinfo:id ],
285- [ sh:description "other names for the person" ;
286- sh:order 2 ;
287- sh:path personinfo:aliases ],
288- [ sh:maxCount 1 ;
289- sh:order 3 ;
290- sh:path schema1:telephone ;
291- sh:pattern "^[\\d\\(\\)\\-]+$" ] ;
292- sh:targetClass schema1:Person .
128+ ```{literalinclude} ../../examples/tutorial/tutorial04/personinfo-semantic.shacl.ttl
129+ :language: turtle
293130```
294131
295132<!-- TODO: SPARQL -->
0 commit comments