Skip to content

Commit 54af71c

Browse files
committed
updated README to reflect id shortcut
1 parent bc2d311 commit 54af71c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ Start by creating the ld-query object:
150150
var context = LD( {
151151
"@vocab": "http://www.schema.org/",
152152
"foaf": "http://xmlns.com/foaf/0.1/",
153-
"ex": "http://www.example.org#"
153+
"ex": "http://www.example.org#",
154+
"isbn": "http://www.isbnsearch.org/isbn/"
154155
} );
155156

156157
var doc = context( data );
@@ -161,7 +162,8 @@ or
161162
var doc = LD( data, {
162163
"@vocab": "http://www.schema.org/",
163164
"foaf": "http://xmlns.com/foaf/0.1/",
164-
"ex": "http://www.example.org#"
165+
"ex": "http://www.example.org#",
166+
"isbn": "http://www.isbnsearch.org/isbn/"
165167
} );
166168
```
167169

@@ -203,6 +205,10 @@ doc.queryAll("somepropertynotinyourdocument @value") // []
203205

204206
doc.query("ex:favouriteReads[@index=pynchon_gp] name @value") // "Gravity's Rainbow"
205207

208+
doc.query("*[@id=isbn:9780143039945] name @value") // "Gravity's Rainbow"
209+
doc.query("[@id=isbn:9780143039945] name @value") // "Gravity's Rainbow"
210+
doc.query("#isbn:9780143039945 name @value") // "Gravity's Rainbow"
211+
206212
doc.queryAll("ex:favouriteReads @index") // [ "banks-exc", "pynchon-gr" ]
207213
doc.query("ex:favouriteReads @id") // [ "http://www.isbnsearch.org/isbn/9780553575378" ]
208214

0 commit comments

Comments
 (0)