/** * Expand qnames to URIs. If the given URI appears * to start with one of the registered prefixes then * expand the prefix, otherwise return the original URI */ public static String expandQname(String uri) { return prefixMapping.expandPrefix( uri ); }
/** * Expand qnames to URIs. If the given URI appears * to start with one of the registered prefixes then * expand the prefix, otherwise return the original URI */ public static String expandQname(String uri) { return prefixMapping.expandPrefix( uri ); }
@Override public String expandPrefix(String prefixed) { return this.prefixes.expandPrefix(prefixed); }
/** Answer the string <code>s</code> prefix-expanded using the built-in PrefixMapping.Extended. */ private String expand( String s ) { return PrefixMapping.Extended.expandPrefix( s ); } }
/** Answer the string <code>s</code> prefix-expanded using the built-in PrefixMapping.Extended. */ private String expand( String s ) { return PrefixMapping.Extended.expandPrefix( s ); } }
protected String resolveIriExpr(String exprStr, Object rootObject) { Expression expression = parser.parseExpression(exprStr, parserContext); String tmp = expression.getValue(evalContext, rootObject, String.class); tmp = tmp.trim(); PrefixMapping prefixMapping = prologue.getPrefixMapping(); String result = prefixMapping.expandPrefix(tmp); return result; }
@Override public String expandPrefix( String prefixed ) { return getPrefixMapping().expandPrefix( prefixed ); }
@Override public String expandPrefix( String prefixed ) { return getPrefixMapping().expandPrefix( prefixed ); }
protected String resolveIriExpr(String exprStr, Object rootObject) { Expression expression = parser.parseExpression(exprStr, parserContext); String tmp = expression.getValue(evalContext, rootObject, String.class); tmp = tmp.trim(); PrefixMapping prefixMapping = prologue.getPrefixMapping(); String result = prefixMapping.expandPrefix(tmp); return result; }
@Override public String expandPrefix(final String prefixed) throws ReadDeniedException, AuthenticationRequiredException { checkRead(); return holder.getBaseItem().expandPrefix(prefixed); }
public ResourceShapeBuilder nav(String propertyUri, boolean isInverse) { String p = prefixMapping.expandPrefix(propertyUri); Node node = NodeFactory.createURI(p); ResourceShapeBuilder result = nav(node, isInverse); return result; }
@Test public void prefix8() { PrefixMapping pmap = create() ; String x = "scheme:i_do_not_exist" ; assertEquals(x, pmap.expandPrefix(x)) ; // Call again - used to cause problems. assertEquals(x, pmap.expandPrefix(x)) ; }
/** * Is the subject the repository root resource. * * @param graph The graph * @param subject The current subject * @return true if has rdf:type http://fedora.info/definitions/v4/repository#RepositoryRoot */ public boolean isRootResource(final Graph graph, final Node subject) { final String rootRes = graph.getPrefixMapping().expandPrefix(FEDORA_REPOSITORY_ROOT); final Node root = createResource(rootRes).asNode(); return graph.contains(subject, rdfType().asNode(), root); }
private void testTypeExpandsPrefix( String type ) { Node n = NodeCreateUtils.create( "'stuff'" + type ); String wanted = PrefixMapping.Extended.expandPrefix( type ); assertEquals( wanted, n.getLiteralDatatypeURI() ); }
public static LiteralLabel literal(PrefixMapping pm, String spelling, String langOrType) { String content = unEscape(spelling); int colon = langOrType.indexOf(':'); return colon < 0 ? LiteralLabelFactory.create(content, langOrType, false) : LiteralLabelFactory.createLiteralLabel(content, "", NodeFactory.getType(pm.expandPrefix(langOrType))); }
public static LiteralLabel literal( PrefixMapping pm, String spelling, String langOrType ) { String content = unEscape( spelling ); int colon = langOrType.indexOf( ':' ); return colon < 0 ? LiteralLabelFactory.create( content, langOrType, false ) : LiteralLabelFactory.create( content, NodeFactory.getType( pm.expandPrefix( langOrType ) ) ) ; }
private void testTypeExpandsPrefix( String type ) { Node n = NodeCreateUtils.create( "'stuff'" + type ); String wanted = PrefixMapping.Extended.expandPrefix( type ); assertEquals( wanted, n.getLiteralDatatypeURI() ); }
public static LiteralLabel literal( PrefixMapping pm, String spelling, String langOrType ) { String content = unEscape( spelling ); int colon = langOrType.indexOf( ':' ); return colon < 0 ? LiteralLabelFactory.create( content, langOrType, false ) : LiteralLabelFactory.create( content, NodeFactory.getType( pm.expandPrefix( langOrType ) ) ) ; }
public static LiteralLabel literal(PrefixMapping pm, String spelling, String langOrType) { String content = unEscape(spelling); int colon = langOrType.indexOf(':'); return colon < 0 ? LiteralLabelFactory.create(content, langOrType, false) : LiteralLabelFactory.createLiteralLabel(content, "", NodeFactory.getType(pm.expandPrefix(langOrType))); }
@Test public void prefix5() { String uri = "http://example/" ; PrefixMapping pmap = create() ; pmap.setNsPrefix("ex", uri) ; assertEquals(uri+"foo", pmap.expandPrefix("ex:foo")) ; }