public class SPTextUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static List<org.apache.jena.rdf.model.Property> |
sparqlProperties |
| Constructor and Description |
|---|
SPTextUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addSPARQLProperty(org.apache.jena.rdf.model.Property predicate) |
static void |
addSPText(Command command)
Adds an sp:text reflecting the SPIN RDF of a given Command.
|
static void |
deleteSPINRDF(org.apache.jena.rdf.model.Model model)
Removes any SPIN RDF syntax triples from a given Model.
|
static void |
ensureSPINRDFExists(org.apache.jena.rdf.model.Model model)
Ensures that each SPIN Command with an sp:text also has the SPIN RDF syntax triples.
|
static void |
ensureSPTextExists(org.apache.jena.rdf.model.Model model)
Ensures that each SPIN Command (query/update) in a given Model has an sp:text triple.
|
static boolean |
hasSPINRDF(org.apache.jena.rdf.model.Resource command)
Checks if a given SPIN Command has at least one other triple beside the rdf:type, sp:text
and spin:thisUnbound triple.
|
static String |
replaceQName(String text,
String qname,
String newQName,
String newURI) |
static boolean |
textContainsQName(String text,
String qname)
Checks if a given SPARQL text contains a given qname - making sure
that they are true references and not part of another qname.
|
public static List<org.apache.jena.rdf.model.Property> sparqlProperties
public static void addSPARQLProperty(org.apache.jena.rdf.model.Property predicate)
public static void addSPText(Command command)
command - the SPIN Command to convertpublic static void deleteSPINRDF(org.apache.jena.rdf.model.Model model)
ensureSPTextExists(Model) beforehand to make
sure that the resulting SPIN resources remain valid.model - the Model to manipulatepublic static void ensureSPINRDFExists(org.apache.jena.rdf.model.Model model)
model - the Model to walk throughpublic static void ensureSPTextExists(org.apache.jena.rdf.model.Model model)
model - the Model to manipulatepublic static boolean hasSPINRDF(org.apache.jena.rdf.model.Resource command)
command - the Command to checkpublic static String replaceQName(String text, String qname, String newQName, String newURI)
public static boolean textContainsQName(String text, String qname)
text - the SPARQL text, e.g. "ASK { ?this ex:name ?name }"qname - the qname, e.g. "ex:name"Copyright © 2017 TopQuadrant, Inc.. All rights reserved.