Class 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 Detail

      • EditN3GeneratorVTwo

        public EditN3GeneratorVTwo()
    • 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)
      • formatLiteral

        protected static String formatLiteral​(org.apache.jena.rdf.model.Literal literal)
      • formatURI

        protected static String formatURI​(String uriStr)