This code:
var store = $rdf.graph() var timeout = 5000 // 5000 ms timeout var fetcher = new $rdf.Fetcher(store, timeout) var url = 'http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl'; fetcher.nowOrWhenFetched(url, function(ok, body, xhr) { if (!ok) { console.log("Oops, something happened and couldn't fetch data"); } else { document.write(store); } })
https://github.com/bshambaugh/node-arc-p5/blob/master/js/tests/test2-rdflib.js
produces this output:
{_:n1 <http://www.w3.org/2000/01/rdf-schema#label> "[17:18:6] Request for http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl" . _:n1 <http://www.w3.org/2007/ont/link#requestedURI> "http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl" . _:n1 <http://www.w3.org/2007/ont/link#status> _:n2 . _:n1 <http://www.w3.org/2007/ont/link#response> _:n3 . _:n3 <http://www.w3.org/2007/ont/http#status> "200" . _:n3 <http://www.w3.org/2007/ont/http#statusText> "OK" . _:n3 <http://www.w3.org/2007/ont/httph#date> "Fri, 27 Jan 2017 23:10:32 GMT" . _:n3 <http://www.w3.org/2007/ont/httph#server> "Apache/2.4.7 (Ubuntu)" . _:n3 <http://www.w3.org/2007/ont/httph#last-modified> "Fri, 27 Jan 2017 21:20:24 GMT" . _:n3 <http://www.w3.org/2007/ont/httph#etag> "\"456-5471a08b84856\"" . _:n3 <http://www.w3.org/2007/ont/httph#accept-ranges> "bytes" . _:n3 <http://www.w3.org/2007/ont/httph#content-length> "1110" . _:n3 <http://www.w3.org/2007/ont/httph#content-type> "text/turtle" . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/iana/media-types/text/turtle#Resource> . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2007/ont/link#Document> . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://purl.org/dc/terms/title> "Food Growing Methods" . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://www.w3.org/2000/01/rdf-schema#comment> "For independence and resource optimization, some or all of the astronauts' diet must be grown in-situ. Various forms have been proposed, from greenhouses to hydroponics, but there must also be optimization in the types of food grown to maximize caloric and nutrient output compared to water and energy input." . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://data.thespaceplan.com/ontologies/lsi#averageEstInvestmentCost> "0.0(investment cost pulled from children pages)" . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://data.thespaceplan.com/ontologies/lsi#averageEstTimetoMaturity> "0.0 (time to maturity pulled from children pages)" . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://data.thespaceplan.com/ontologies/lsi#commercialStatus> "Research" . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://data.thespaceplan.com/ontologies/lsi#relatedIndustriesFields> "Health and Medicine" . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://data.thespaceplan.com/ontologies/lsi#label> <http://investors.ddns.net:8080/marmotta/ldp/waypaver-lsi/biological-support> . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://data.thespaceplan.com/ontologies/lsi#label> <http://investors.ddns.net:8080/marmotta/ldp/waypaver-lsi/habitation-infrastructure> . <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2007/ont/link#RDFDocument> .}
I'm not sure how to extract on the elements of the object that contain <http://localhost/node-arc-p5/data/Food-Growing-Methods.ttl> .
No comments:
Post a Comment