Skip to content
Snippets Groups Projects

SPARQL sensor metadata query

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Steve Battle
    sensor.sparql 351 B
    from rdflib import Graph
    g = Graph()
    g.parse("https://sa-battle.github.io/bedroomNode1.ttl", format="turtle")
    sparql = """
    prefix sosa: <http://www.w3.org/ns/sosa/>
    select ?label ?comment where {
    	[] a sosa:Sensor ;
        rdfs:label ?label ;
        rdfs:comment ?comment .
    }
    """
    results = g.query(sparql)
    print(str(results.serialize(format='csv'),'utf-8'))
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment