public static String getUriTemplateString(Function uriTemplate, PrefixManager prefixmng) { String template = getUriTemplateString(uriTemplate); try { template = prefixmng.getExpandForm(template); } catch (InvalidPrefixWritingException ex) { // in this case, the we do not need to expand } return template; }
/** * This method instantiates the input uri template by arguments * <p> * <p> * <p> * Example: * <p> * <p> * {@code URITemplates.format("http://example.org/{}/{}", "A", 1)} results {@code "http://example.org/A/1" } * * @param uriTemplate String with placeholder * @param args args * @return a formatted string */ public static String format(String uriTemplate, Object... args) { return format(uriTemplate, Arrays.asList(args)); }
public static String getUriTemplateString(ImmutableFunctionalTerm uriTemplate, PrefixManager prefixmng) { String template = getUriTemplateString(uriTemplate); try { template = prefixmng.getExpandForm(template); } catch (InvalidPrefixWritingException ex) { // in this case, the we do not need to expand } return template; }
/** * This method instantiates the input uri template by arguments * <p> * <p> * <p> * Example: * <p> * <p> * {@code URITemplates.format("http://example.org/{}/{}", "A", 1)} results {@code "http://example.org/A/1" } * * @param uriTemplate String with placeholder * @param args args * @return a formatted string */ public static String format(String uriTemplate, Object... args) { return format(uriTemplate, Arrays.asList(args)); }
public static String getUriTemplateString(Function uriTemplate, PrefixManager prefixmng) { String template = getUriTemplateString(uriTemplate); try { template = prefixmng.getExpandForm(template); } catch (InvalidPrefixWritingException ex) { // in this case, the we do not need to expand } return template; }
/** * This method instantiates the input uri template by arguments * <p> * <p> * <p> * Example: * <p> * <p> * {@code URITemplates.format("http://example.org/{}/{}", "A", 1)} results {@code "http://example.org/A/1" } * * @param uriTemplate String with placeholder * @param args args * @return a formatted string */ public static String format(String uriTemplate, Object... args) { return format(uriTemplate, Arrays.asList(args)); }
String subjectTemplate = URITemplates.getUriTemplateString(uriTemplate, prefixmng); predURIString = URITemplates.getUriTemplateString(predf, prefixmng); predUri = vf.createURI(predURIString); String objectURI = URITemplates.getUriTemplateString((Function)object, prefixmng);
private static String getPredicateName(ImmutableTerm templateTerm, List<String> values) { if (templateTerm instanceof Variable) { return values.get(0); } else { String uriTemplate = ((ValueConstant) templateTerm).getValue(); return URITemplates.format(uriTemplate, values); } } }
String subjectTemplate = URITemplates.getUriTemplateString(uriTemplate, prefixmng); Template templs = mfact.createTemplate(subjectTemplate); SubjectMap sm = mfact.createSubjectMap(templs); predUri = rdfFactory.createIRI(URITemplates.getUriTemplateString(predf, prefixmng)); templp = Optional.of(mfact.createTemplate(subjectTemplate)); String objectURI = URITemplates.getUriTemplateString(o, prefixmng);
private static String getPredicateName(Term templateTerm, List<String> values) { if (templateTerm instanceof Variable) { return values.get(0); } else { String uriTemplate = ((ValueConstant) templateTerm).getValue(); return URITemplates.format(uriTemplate, values); } } }
String subjectTemplate = URITemplates.getUriTemplateString(uriTemplate, prefixmng); Template templs = mfact.createTemplate(subjectTemplate); SubjectMap sm = mfact.createSubjectMap(templs); predURIString = URITemplates.getUriTemplateString(predf, prefixmng); predUri = vf.createURI(predURIString); templp = Optional.of(mfact.createTemplate(subjectTemplate)); String objectURI = URITemplates.getUriTemplateString((Function) object, prefixmng);
String uriTemplate = ((ValueConstant) uriTermForPredicateTerm).getValue(); predName = URITemplates.format(uriTemplate, values);