Search in sources :

Example 6 with DatasetRef

use of org.apache.jena.fuseki.server.DatasetRef in project jena by apache.

the class MgtFunctions method serviceGraphRead.

/** Return a SPARQL Graph Store Protocol (Read) service name for the dataset */
public static String serviceGraphRead(String dataset) {
    String dft = "get";
    DatasetRef ref = getFromRegistry(dataset);
    if (ref == null)
        return dft;
    return serviceNameOrDefault(ref.readGraphStore, dft);
}
Also used : DatasetRef(org.apache.jena.fuseki.server.DatasetRef)

Example 7 with DatasetRef

use of org.apache.jena.fuseki.server.DatasetRef in project jena by apache.

the class MgtFunctions method serviceUpload.

/** Return a SPARQL upload service name for the dataset */
public static String serviceUpload(String dataset) {
    String dft = "upload";
    DatasetRef ref = getFromRegistry(dataset);
    if (ref == null)
        return dft;
    return serviceNameOrDefault(ref.upload, dft);
}
Also used : DatasetRef(org.apache.jena.fuseki.server.DatasetRef)

Example 8 with DatasetRef

use of org.apache.jena.fuseki.server.DatasetRef in project jena by apache.

the class MgtFunctions method serviceUpdate.

/** Return a SPARQL update service name for the dataset */
public static String serviceUpdate(String dataset) {
    String dft = "update";
    DatasetRef ref = getFromRegistry(dataset);
    if (ref == null)
        return dft;
    return serviceNameOrDefault(ref.update, dft);
}
Also used : DatasetRef(org.apache.jena.fuseki.server.DatasetRef)

Example 9 with DatasetRef

use of org.apache.jena.fuseki.server.DatasetRef in project jena by apache.

the class MgtFunctions method serviceGraphReadWrite.

/** Return a SPARQL Graph Store Protocol (Read-Write) service name for the dataset */
public static String serviceGraphReadWrite(String dataset) {
    String dft = "data";
    DatasetRef ref = getFromRegistry(dataset);
    if (ref == null)
        return dft;
    return serviceNameOrDefault(ref.readWriteGraphStore, dft);
}
Also used : DatasetRef(org.apache.jena.fuseki.server.DatasetRef)

Example 10 with DatasetRef

use of org.apache.jena.fuseki.server.DatasetRef in project jena by apache.

the class MgtFunctions method prefixes.

/** Return prefixes for the datasets, SPARQL syntax. */
public static String prefixes(HttpServletRequest request) {
    String dsName = dataset(request);
    DatasetRef desc = getFromRegistry(dsName);
    if (desc == null)
        return "<not found>";
    DatasetGraph dsg = desc.dataset;
    if (dsg instanceof DatasetGraphTDB) {
        PrefixMapping pmap = ((DatasetGraphTDB) dsg).getPrefixes().getPrefixMapping();
        Prologue prologue = new Prologue(pmap);
        IndentedLineBuffer buff = new IndentedLineBuffer();
        PrologueSerializer.output(buff, prologue);
        buff.append("\n");
        return buff.asString();
    }
    return "";
}
Also used : PrefixMapping(org.apache.jena.shared.PrefixMapping) Prologue(org.apache.jena.sparql.core.Prologue) DatasetRef(org.apache.jena.fuseki.server.DatasetRef) DatasetGraph(org.apache.jena.sparql.core.DatasetGraph) DatasetGraphTDB(org.apache.jena.tdb.store.DatasetGraphTDB) IndentedLineBuffer(org.apache.jena.atlas.io.IndentedLineBuffer)

Aggregations

DatasetRef (org.apache.jena.fuseki.server.DatasetRef)10 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 IndentedLineBuffer (org.apache.jena.atlas.io.IndentedLineBuffer)1 DatasetRegistry (org.apache.jena.fuseki.server.DatasetRegistry)1 SPARQLServer (org.apache.jena.fuseki.server.SPARQLServer)1 HttpAction (org.apache.jena.fuseki.servlets.HttpAction)1 PrefixMapping (org.apache.jena.shared.PrefixMapping)1 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)1 Prologue (org.apache.jena.sparql.core.Prologue)1 DatasetGraphTDB (org.apache.jena.tdb.store.DatasetGraphTDB)1