Skip to content

Commit

Permalink
updated README to reflect id shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
goofballLogic committed Jan 28, 2020
1 parent bc2d311 commit 54af71c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ Start by creating the ld-query object:
var context = LD( {
"@vocab": "http://www.schema.org/",
"foaf": "http://xmlns.com/foaf/0.1/",
"ex": "http://www.example.org#"
"ex": "http://www.example.org#",
"isbn": "http://www.isbnsearch.org/isbn/"
} );

var doc = context( data );
Expand All @@ -161,7 +162,8 @@ or
var doc = LD( data, {
"@vocab": "http://www.schema.org/",
"foaf": "http://xmlns.com/foaf/0.1/",
"ex": "http://www.example.org#"
"ex": "http://www.example.org#",
"isbn": "http://www.isbnsearch.org/isbn/"
} );
```

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

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

doc.query("*[@id=isbn:9780143039945] name @value") // "Gravity's Rainbow"
doc.query("[@id=isbn:9780143039945] name @value") // "Gravity's Rainbow"
doc.query("#isbn:9780143039945 name @value") // "Gravity's Rainbow"

doc.queryAll("ex:favouriteReads @index") // [ "banks-exc", "pynchon-gr" ]
doc.query("ex:favouriteReads @id") // [ "http://www.isbnsearch.org/isbn/9780553575378" ]

Expand Down

0 comments on commit 54af71c

Please sign in to comment.