public class PropertyChainTranslator extends Object
Each property chain X = P.Q ... generates a SPARQL clause OPTIONAL {?item P ?v1. OPTIONAL {?v1 Q ?v2}} etc. The variables are allocated by a VarSupply supplied as a parameter.
Modifier and Type | Class and Description |
---|---|
static class |
PropertyChainTranslator.Vars |
Constructor and Description |
---|
PropertyChainTranslator(List<PropertyChain> chains)
Initialise this translator with the given list of property chains.
|
PropertyChainTranslator(PropertyChain... chains)
Initialise this translator with the given array of property chains.
|
Modifier and Type | Method and Description |
---|---|
String |
translate(PropertyChainTranslator.Vars vars,
String subjectVar,
boolean dropLast) |
String |
translate(VarSupply vs,
boolean dropLast)
Translate this collection of property chains to the corresponding
SPARQL clauses.
|
String |
translate(VarSupply vs,
String subjectVar,
boolean dropLast)
Translate this collection of property chains to the corresponding
SPARQL optional clauses.
|
public PropertyChainTranslator(List<PropertyChain> chains)
public PropertyChainTranslator(PropertyChain... chains)
public String translate(VarSupply vs, boolean dropLast)
public String translate(VarSupply vs, String subjectVar, boolean dropLast)
public String translate(PropertyChainTranslator.Vars vars, String subjectVar, boolean dropLast)
Copyright © 2014. All Rights Reserved.