Package org.apache.jena.sparql.core
Class Prologue
- java.lang.Object
-
- org.apache.jena.sparql.core.Prologue
-
- Direct Known Subclasses:
Query
,UpdateRequest
public class Prologue extends java.lang.Object
Prologue - combines with PrefixMapping (the RIOT Prologue uses PrefixMap)
-
-
Constructor Summary
Constructors Constructor Description Prologue()
Prologue(PrefixMapping pmap)
Prologue(PrefixMapping pmap, IRIxResolver resolver)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Prologue
copy()
java.lang.String
expandPrefixedName(java.lang.String prefixed)
Expand prefixed nameboolean
explicitlySetBaseURI()
IRIx
getBase()
java.lang.String
getBaseURI()
java.lang.String
getPrefix(java.lang.String prefix)
Lookup a prefix for this query, including the default prefixesPrefixMapping
getPrefixMapping()
Return the prefix map from the parsed queryIRIxResolver
getResolver()
static int
hash(Prologue prologue)
boolean
samePrologue(Prologue other)
Test whether a Prologue will perform the same as this one.void
setBase(IRIx base)
void
setBaseURI(java.lang.String baseURI)
void
setPrefix(java.lang.String prefix, java.lang.String expansion)
Set a prefix for this queryvoid
setPrefixMapping(PrefixMapping pmap)
Set the mappingjava.lang.String
shortForm(java.lang.String uri)
Use the prefix map to turn a URI into a qname, or return the original URI
-
-
-
Constructor Detail
-
Prologue
public Prologue()
-
Prologue
public Prologue(PrefixMapping pmap)
-
Prologue
public Prologue(PrefixMapping pmap, IRIxResolver resolver)
-
-
Method Detail
-
copy
public Prologue copy()
-
explicitlySetBaseURI
public boolean explicitlySetBaseURI()
- Returns:
- True if the query has an explicitly set base URI.
-
getBaseURI
public java.lang.String getBaseURI()
- Returns:
- Returns the baseURI, if set.
-
getBase
public IRIx getBase()
-
setBase
public void setBase(IRIx base)
-
getResolver
public IRIxResolver getResolver()
-
setBaseURI
public void setBaseURI(java.lang.String baseURI)
- Parameters:
baseURI
- The baseURI to set.
-
setPrefix
public void setPrefix(java.lang.String prefix, java.lang.String expansion)
Set a prefix for this query
-
getPrefixMapping
public PrefixMapping getPrefixMapping()
Return the prefix map from the parsed query
-
setPrefixMapping
public void setPrefixMapping(PrefixMapping pmap)
Set the mapping
-
getPrefix
public java.lang.String getPrefix(java.lang.String prefix)
Lookup a prefix for this query, including the default prefixes
-
expandPrefixedName
public java.lang.String expandPrefixedName(java.lang.String prefixed)
Expand prefixed name- Parameters:
prefixed
- The prefixed name to be expanded- Returns:
- URI, or null if not expanded.
-
shortForm
public java.lang.String shortForm(java.lang.String uri)
Use the prefix map to turn a URI into a qname, or return the original URI
-
samePrologue
public boolean samePrologue(Prologue other)
Test whether a Prologue will perform the same as this one.
-
hash
public static int hash(Prologue prologue)
-
-