Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDF and N3 format examples? #3

Open
markfarrell opened this issue Apr 22, 2015 · 4 comments
Open

RDF and N3 format examples? #3

markfarrell opened this issue Apr 22, 2015 · 4 comments

Comments

@markfarrell
Copy link
Member

What should the response look like when rdf or n3 are selected as formats in a request?

@rwarren2
Copy link
Contributor

See the redland library bindings. You are better off to create the content in memory and then serialize it out to the web server - at least for the headers.
http://librdf.org/

@markfarrell
Copy link
Member Author

Using redland/librdf. Are these responses correct?

N-triples example:

GET http://.../?bbox=2.3,50.35,2.35,50.40&format=ntriples&scale=90&proj=wgs84

_:2f60a0dbca51c3b2e010dc050ebb8b8b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2003/01/geo/wgs84_pos#Point> .
_:2f60a0dbca51c3b2e010dc050ebb8b8b <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30041666666666655" .
_:2f60a0dbca51c3b2e010dc050ebb8b8b <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323" .
_:2f60a0dbca51c3b2e010dc050ebb8b8b <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "104" .
_:44bb8c69da389a0b9047572cab6eee1c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2003/01/geo/wgs84_pos#Point> .
_:44bb8c69da389a0b9047572cab6eee1c <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30125000000000002" .
_:44bb8c69da389a0b9047572cab6eee1c <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323" .
_:44bb8c69da389a0b9047572cab6eee1c <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "102" .
_:09224095e8a6343159d353062ac50754 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2003/01/geo/wgs84_pos#Point> .
_:09224095e8a6343159d353062ac50754 <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30208333333333304" .
_:09224095e8a6343159d353062ac50754 <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323" .
_:09224095e8a6343159d353062ac50754 <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "100" .
_:68dcf28d43d9fb664ed7281ce1e474cc <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2003/01/geo/wgs84_pos#Point> .
_:68dcf28d43d9fb664ed7281ce1e474cc <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.3029166666666665" .
_:68dcf28d43d9fb664ed7281ce1e474cc <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323" .
_:68dcf28d43d9fb664ed7281ce1e474cc <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "99" .
_:a315457873e711b9a47afb79c8158063 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2003/01/geo/wgs84_pos#Point> .
_:a315457873e711b9a47afb79c8158063 <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30374999999999996" .
_:a315457873e711b9a47afb79c8158063 <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323" .
_:a315457873e711b9a47afb79c8158063 <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "98" .
_:4b110d12fd76e501fbd6f1f8e943ae6b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2003/01/geo/wgs84_pos#Point> .
_:4b110d12fd76e501fbd6f1f8e943ae6b <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30458333333333298" .
_:4b110d12fd76e501fbd6f1f8e943ae6b <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323" .
_:4b110d12fd76e501fbd6f1f8e943ae6b <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "95" .
...

RDF/XML example:

GET http://.../?bbox=2.3,50.35,2.35,50.40&format=rdf/xml&scale=90&proj=wgs84

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:nodeID="2f60a0dbca51c3b2e010dc050ebb8b8b">
    <rdf:type rdf:resource="http://www.w3.org/2003/01/geo/wgs84_pos#Point"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="2f60a0dbca51c3b2e010dc050ebb8b8b">
    <ns0:long xmlns:ns0="http://www.w3.org/2003/01/geo/wgs84_pos#">2.30041666666666655</ns0:long>
  </rdf:Description>
  <rdf:Description rdf:nodeID="2f60a0dbca51c3b2e010dc050ebb8b8b">
    <ns0:lat xmlns:ns0="http://www.w3.org/2003/01/geo/wgs84_pos#">50.3995833333333323</ns0:lat>
  </rdf:Description>
  <rdf:Description rdf:nodeID="2f60a0dbca51c3b2e010dc050ebb8b8b">
    <ns0:alt xmlns:ns0="http://www.w3.org/2003/01/geo/wgs84_pos#">104</ns0:alt>
  </rdf:Description>
</rdf:RDF>
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:nodeID="44bb8c69da389a0b9047572cab6eee1c">
    <rdf:type rdf:resource="http://www.w3.org/2003/01/geo/wgs84_pos#Point"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="44bb8c69da389a0b9047572cab6eee1c">
    <ns0:long xmlns:ns0="http://www.w3.org/2003/01/geo/wgs84_pos#">2.30125000000000002</ns0:long>
  </rdf:Description>
  <rdf:Description rdf:nodeID="44bb8c69da389a0b9047572cab6eee1c">
    <ns0:lat xmlns:ns0="http://www.w3.org/2003/01/geo/wgs84_pos#">50.3995833333333323</ns0:lat>
  </rdf:Description>
  <rdf:Description rdf:nodeID="44bb8c69da389a0b9047572cab6eee1c">
    <ns0:alt xmlns:ns0="http://www.w3.org/2003/01/geo/wgs84_pos#">102</ns0:alt>
  </rdf:Description>
</rdf:RDF>
...

N3 Example:

GET http://.../?bbox=2.3,50.35,2.35,50.40&format=n3&scale=90&proj=wgs84

[ a <http://www.w3.org/2003/01/geo/wgs84_pos#Point>;
    <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "104";
    <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323";
    <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30041666666666655"] .

 [ a <http://www.w3.org/2003/01/geo/wgs84_pos#Point>;
    <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "102";
    <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323";
    <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30125000000000002"] .

 [ a <http://www.w3.org/2003/01/geo/wgs84_pos#Point>;
    <http://www.w3.org/2003/01/geo/wgs84_pos#alt> "100";
    <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "50.3995833333333323";
    <http://www.w3.org/2003/01/geo/wgs84_pos#long> "2.30208333333333304"] .

@rwarren2
Copy link
Contributor

<rdf:Description rdf:nodeID= should be <rdf:Description rdf:about= but that might be a parser problem.

@rwarren2
Copy link
Contributor

Remember to add the prov triple to every node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants