SPARQL Samples

Sample SPAQRL query to find historical cash held by IBM

# Sample SPARQL of XBRL data
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix usgaap: <http://xbrl.us/us-gaap/2008-01-31>
prefix xbrli: <http://www.xbrl.org/2003/instance>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?cash ?date
WHERE{
[]  rdf:type usgaap:CashAndCashEquivalentsAtCarryingValue ;
    rdf:value ?cash;
    xbrli:context [xbrli:entity [xbrli:identifier [xbrli:schema <http://www.nyse.com/>;
                                                   rdf:value  "IBM"];
                   xbrli:period [xbrli:onDate ?date ]]].
FILTER (?date > "2005-12-31"^^xsd:date)
}
LIMIT 10

N3 Samples

@prefix edgar: <http://www.sec.gov/Archives/>.
@prefix ov: <http://owl.openvest.org/2005/10/Portfolio#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@base <http://www.w3.org/2000/01/rdf-schema#>.
 <http://www.sec.gov/Archives/edgar/data/1004155/000114036107018513> a edgar:edgarxbrlFiling;
     edgar:edgaraccessionNumber "000114036107018513";
     edgar:edgarcikNumber "0001004155";
     edgar:edgarcompanyName "AGL RESOURCES INC";
     edgar:edgarfileNumber "001-14174";
     edgar:edgarfilingDate "2007-09-21"^^<http://www.w3.org/2001/XMLSchema#date>;
     edgar:edgarformType "8-K";
     edgar:edgarxbrlFiles [ a rdf:Seq;
             rdf:_1 <http://www.sec.gov/Archives/edgar/data/1004155/000114036107018513/exhibit_100.xml>;
             rdf:_2 <http://www.sec.gov/Archives/edgar/data/1004155/000114036107018513/exhibit_100-pre.xml>;
             rdf:_3 <http://www.sec.gov/Archives/edgar/data/1004155/000114036107018513/exhibit_100-lab.xml>;
             rdf:_4 <http://www.sec.gov/Archives/edgar/data/1004155/000114036107018513/exhibit_100-cal.xml>;
             rdf:_5 <http://www.sec.gov/Archives/edgar/data/1004155/000114036107018513/exhibit_100-sch.xsd>].

Return to the FrontPage | Edit SparqlXbrlQuery | Title List