Class EditN3GeneratorVTwo
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditN3GeneratorVTwo
-
public class EditN3GeneratorVTwo extends Object
Builds the N3 strings for the given EditConfiguration, model and EditSubmission. Main responsibility is the proper substitution of URI and literal strings in to the template N3.
-
-
Constructor Summary
Constructors Constructor Description EditN3GeneratorVTwo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static StringformatLiteral(org.apache.jena.rdf.model.Literal literal)protected static StringformatURI(String uriStr)protected static voidpyString(StringBuffer sbuff, String s)protected StringquoteForN3(String in)protected StringsubInLiterals(String var, org.apache.jena.rdf.model.Literal literal, String target)When we sub in literals we have to take in to account the Lang or Datatype of the literal.voidsubInLiterals(Map<String,org.apache.jena.rdf.model.Literal> varsToVals, List<String> n3targets)protected StringsubInMultiLiterals(String var, List<org.apache.jena.rdf.model.Literal> values, String n3)voidsubInMultiLiterals(Map<String,List<org.apache.jena.rdf.model.Literal>> varsToVals, List<String> n3targets)This is the method to use to substitute in Literals into variables of target N3 strings.voidsubInMultiUris(Map<String,List<String>> varsToVals, List<String> n3targets)This is the method to use to substitute in URIs into variables of target N3 strings.protected StringsubInNonBracketedURIS(String var, String value, String target)StringsubInUris(String var, String value, String target)voidsubInUris(String var, String value, List<String> targets)voidsubInUris(Map<String,String> varsToVals, List<String> targets)The List targets will be modified.
-
-
-
Method Detail
-
subInMultiUris
public void subInMultiUris(Map<String,List<String>> varsToVals, List<String> n3targets)
This is the method to use to substitute in URIs into variables of target N3 strings. This takes into account multiple values that would be returned from a select list. subInUris should no longer be used. It's important that the map contain String to List<String> mapping. Before values are sent in, all of the values for a variable should be placed within an array. The List n3targets will be modified.
-
subInUris
public void subInUris(Map<String,String> varsToVals, List<String> targets)
The List targets will be modified.
-
subInMultiLiterals
public void subInMultiLiterals(Map<String,List<org.apache.jena.rdf.model.Literal>> varsToVals, List<String> n3targets)
This is the method to use to substitute in Literals into variables of target N3 strings. This takes into account multiple values that would be returned from a select list. subInUris should no longer be used. It will modify the list n3targets.
-
subInLiterals
public void subInLiterals(Map<String,org.apache.jena.rdf.model.Literal> varsToVals, List<String> n3targets)
-
subInLiterals
protected String subInLiterals(String var, org.apache.jena.rdf.model.Literal literal, String target)
When we sub in literals we have to take in to account the Lang or Datatype of the literal. N3 needs to have its literals escaped in Python style. Java regex Matcher is used to do the substitution and it need escaping to avoid group references, Matcher.quoteReplacement() serves the purpose.
-
subInMultiLiterals
protected String subInMultiLiterals(String var, List<org.apache.jena.rdf.model.Literal> values, String n3)
-
subInNonBracketedURIS
protected String subInNonBracketedURIS(String var, String value, String target)
-
formatLiteral
protected static String formatLiteral(org.apache.jena.rdf.model.Literal literal)
-
pyString
protected static void pyString(StringBuffer sbuff, String s)
-
-