Where do I test my queries for my RDF written in SPARQL

后端 未结 2 1046
执笔经年
执笔经年 2021-02-02 12:16

I am a beginner with Semantic Web technologies, My question might be a very basic one but I am really stuck figuring it out. I have a RDF file I created from an XML and have va

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-02 12:58

    You could set up your own local SPARQL endpoint using Fuseki. Fuseki is part of the Apache Jena Project but can be downloaded as a standalone application (at the link above).

    With Fuseki you can (amongst other stuff)

    1. load a local RDF dataset
    2. use that dataset to
      • expose this data as a SPARQL endpoint via http://localhost:3030/ (by default)
      • use a web based query form at http://localhost:3030/sparql.html

    That means you can use Fuseki to either simply query your dataset using the web based form or to query your dataset using any application that queries SPARQL endpoints over http.

    Personally, I am currently developing an application that analyses datasets via SPARQL endpoints. I use Fuseki to set up a local SPARQL endpoint with example data that I can run and test my application against.


    How?

    Fuseki's basic functionality is rather easy to use. The line below will start the server (SPARQL endpoint).

    java -jar fuseki-server.jar --config=yourConfig.ttl
    

    The file yourConfig.ttl is a RDF file (in turtle serialization format). To set up a basic server that loads your RDF file to memory just write (replacing at least the path to your dataset file):

    # Attention: I have omitted the @prefix declarations
    
    [] rdf:type fuseki:Server ;
       fuseki:services (
     <#yourService>
    ) .
    
    <#yourService> rdf:type fuseki:Service ;
    fuseki:name                     "yourService" ;
    fuseki:serviceQuery             "query" ;
    fuseki:serviceReadGraphStore    "get" ;
    fuseki:dataset                   <#yourDataset> ;
    .
    
    <#yourDataset>    rdf:type ja:RDFDataset ;
    rdfs:label "a label for your dataset" ;
    ja:defaultGraph 
      [ rdfs:label "yourDataset.rdf" ;
        a ja:MemoryModel ;
        ja:content [ja:externalContent  ] ;
      ] ;
    .
    

提交回复
热议问题