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
package example; | |
import com.hp.hpl.jena.query.Query; | |
import com.hp.hpl.jena.query.QueryExecution; | |
import com.hp.hpl.jena.query.QueryExecutionFactory; | |
import com.hp.hpl.jena.query.QueryFactory; | |
import com.hp.hpl.jena.query.ResultSet; | |
import com.hp.hpl.jena.query.ResultSetFormatter; | |
import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; |
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
# assumes you have set the value of KASABI_API_KEY in your shell session or .profile | |
curl -v -X GET "http://api.kasabi.com/dataset/nasa/apis/search?apikey=$KASABI_API_KEY&query=apollo" | xmllint --format - |
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
############################################# | |
## Quick and dirty curl | |
############################################# | |
# Get a snippet of javascript | |
curl -v -X GET "http://api.kasabi.com/dataset/nasa/attribution" | |
# Get the attribution as JSON | |
curl -v -X GET "http://api.kasabi.com/dataset/nasa/attribution?output=json" |
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
######################################## | |
## Quick curl commands | |
######################################## | |
# get the response as RDF | |
curl -v -X GET "http://api.kasabi.com/dataset/airlines/apis/lookup?about=http://data.kasabi.com/dataset/airlines/MYL&output=rdf&apikey=$KASABI_API_KEY" | |
# get the response as JSON | |
curl -v -X GET "http://api.kasabi.com/dataset/airlines/apis/lookup?about=http://data.kasabi.com/dataset/airlines/MYL&output=json&apikey=$KASABI_API_KEY" |
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
######################################## | |
## Quick curl commands | |
######################################## | |
# get the response as RDF | |
curl -v -X GET "http://api.kasabi.com/dataset/airlines/apis/sparql?query=describe%20?s1%20where%20%7B%0A%20%20?s1%20a%20%3Chttp://xmlns.com/foaf/0.1/Organisation%3E%20.%0A%20%20%7D%0ALimit%2010&output=rdf&apikey=$KASABI_API_KEY" | |
# get the response as JSON | |
curl -v -X GET "http://api.kasabi.com/dataset/airlines/apis/sparql?query=describe%20?s1%20where%20%7B%0A%20%20?s1%20a%20%3Chttp://xmlns.com/foaf/0.1/Organisation%3E%20.%0A%20%20%7D%0ALimit%2010&output=json&apikey=$KASABI_API_KEY" |
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
######################################## | |
## Quick curl examples | |
######################################## | |
# Search for Queen Victoria in the Government Art Collection - JSON results | |
curl -v -X GET "http://api.kasabi.com/dataset/government-art-collection/apis/search?apikey=$KASABI_API_KEY&query=Queen+Victoria&output=json" | |
# Search for Queen Victoria in the Government Art Collection - XML results | |
curl -v -X GET "http://api.kasabi.com/dataset/government-art-collection/apis/search?apikey=$KASABI_API_KEY&query=Queen+Victoria&output=xml" | xmllint --format - |
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
######################################## | |
## Quick curl examples | |
######################################## | |
# Search for Queen Victoria in the Government Art Collection - JSON results | |
curl -v -X GET "http://api.kasabi.com/dataset/government-art-collection/apis/search/solr?apikey=$KASABI_API_KEY&q=Queen+Victoria&wt=json" | |
# Search for Queen Victoria in the Government Art Collection - XML results | |
curl -v -X GET "http://api.kasabi.com/dataset/government-art-collection/apis/search/solr?apikey=$KASABI_API_KEY&q=Queen+Victoria&wt=xml" | xmllint --format - |
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
<?php | |
/** | |
* This example script will search for a term in the government art collection, and | |
* retrieve some more RDF about a particular type of thing we are interested in. | |
* This demonstrates the Follow-Your-Nose Paradigm possible with Linked Data. | |
* | |
* The program runs like this: | |
* - Use the SPARQL API to find some things which have an image and filter out | |
* only those which have a certain term in the title |
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
# This request is only successful if you are the dataset owner. | |
# i.e. your API key is the same as the owner of the dataset's API key. | |
curl -v -X GET "http://api.kasabi.com/dataset/government-art-collection/status/1?apikey=$KASABI_API_KEY" |
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
# where patterns are in files numbered like pattern_file_01.txt | |
for pattern in `ls pattern_file_??.txt` | |
do | |
STRING=`cat $pattern` | |
php -f myCleverScipt.php -- $STRING | |
done | |
# where patterns are single lines of a single file | |
while read line |