Last active
August 29, 2015 14:26
-
-
Save jineshpaloor/9c842a8674c885881d07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./stardog query --reasoning foafDB "PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
| SELECT ?name | |
| WHERE { | |
| ?person foaf:name ?name . | |
| } | |
| " | |
| # example: A part from a owl / rdf | |
| <rdf:Description rdf:about="http://dig.csail.mit.edu/2008/webdav/timbl/foaf.rdf#dj"> | |
| <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/> | |
| <s:seeAlso rdf:resource="http://www.grorg.org/dean/foaf.rdf"/> | |
| <foaf:homepage rdf:resource="http://www.grorg.org/dean/"/> | |
| <foaf:mbox rdf:resource="mailto:dean@w3.org"/> | |
| <foaf:mbox rdf:resource="mailto:dino@grorg.org"/> | |
| <foaf:mbox_sha1sum>6de4ff27ef927b9ba21ccc88257e41a2d7e7d293</foaf:mbox_sha1sum> | |
| <foaf:name>Dean Jackson</foaf:name> | |
| </rdf:Description> | |
| Here the "<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>" says the subject of that rdf piece is person. | |
| foaf:name in the query will search for all the predicates of the form "<foaf:name>Dean Jackson</foaf:name>". | |
| And the ?name part in the query will extract the value. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment