Class PrefixDeclProcessor
java.lang.Object
org.eclipse.rdf4j.query.parser.sparql.PrefixDeclProcessor
Processes the prefix declarations in a SPARQL query model.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
createPrefixesInSPARQLFormat
(Map<String, String> prefixMap) private static int
process
(ASTOperationContainer qc, Map<String, String> customDefaultPrefixes) Processes prefix declarations in queries.
-
Constructor Details
-
PrefixDeclProcessor
public PrefixDeclProcessor()
-
-
Method Details
-
process
public static Map<String,String> process(ASTOperationContainer qc, Map<String, String> customDefaultPrefixes) throws MalformedQueryExceptionProcesses prefix declarations in queries. This method collects all prefixes that are declared in the supplied query, verifies that prefixes are not redefined and replaces anyASTQName
nodes in the query with equivalentASTIRI
nodes.- Parameters:
qc
- The query that needs to be processed.customDefaultPrefixes
- Custom prefixes to add, will override SPARQL default prefixes. can't be null.- Returns:
- A map containing the prefixes that are declared in the query (key) and the namespace they map to (value).
- Throws:
MalformedQueryException
- If the query contains redefined prefixes or qnames that use undefined prefixes.
-
insertDefaultPrefix
-
createPrefixesInSPARQLFormat
-