本文整理汇总了Java中org.openrdf.model.URI.stringValue方法的典型用法代码示例。如果您正苦于以下问题:Java URI.stringValue方法的具体用法?Java URI.stringValue怎么用?Java URI.stringValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openrdf.model.URI
的用法示例。
在下文中一共展示了URI.stringValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.openrdf.model.URI; //导入方法依赖的package包/类
/**
* Transform a statement pattern according to OWL-2 inverse properties
* axiom.
*
* @param node the node to transform
* @return list of nodes to visit next
*/
@Override
public List<QueryModelNode> apply(StatementPattern node) {
List<QueryModelNode> next = newNextList();
Var s = node.getSubjectVar();
Var p = node.getPredicateVar();
Var o = node.getObjectVar();
Var c = node.getContextVar();
URI uri = (URI) p.getValue();
String op = uri.stringValue();
Var p2;
// check if need to replace with op1 or op2
if (op.equals(op1)) {
p2 = new ConstVar(vf.createURI(op2));
} else {
p2 = new ConstVar(vf.createURI(op1));
}
StatementPattern left = node.clone();
// switch subject and object and replace predicate
StatementPattern right = new StatementPattern(o, p2, s, c);
node.replaceWith(new Union(left, right));
next.add(left);
next.add(right);
return next;
}
示例2: getURIString
import org.openrdf.model.URI; //导入方法依赖的package包/类
/**
* Returns the URI of a constant {@link Var} object.
*
* @param v the {@link Var} object
* @return URI as string if it is a URI, null otherwise
*/
protected String getURIString(Var v) {
if (v.isConstant()) {
Value val = v.getValue();
if (val instanceof URI) {
URI uri = (URI) val;
return uri.stringValue();
}
}
return null;
}
示例3: testParseXMLDatatype
import org.openrdf.model.URI; //导入方法依赖的package包/类
@Test
public void testParseXMLDatatype() {
String id = "someID";
URI theClass = XMLSchema.DOUBLE;
String input = "data\"3.0\"" + theClass.stringValue() + "\"";
Object returnedInstance = RDFDatatypeTools.parseXMLDatatype( input );
assertEquals( returnedInstance.getClass(), Double.class );
}
示例4: createOrRetrieveVertex
import org.openrdf.model.URI; //导入方法依赖的package包/类
protected SEMOSSVertex createOrRetrieveVertex( URI vertexKey, int overlayLevel ) {
URI uri = new URIImpl( vertexKey.stringValue() );
if ( !vertStore.containsKey( uri ) ) {
SEMOSSVertex vertex = createVertex( uri );
level.put( vertex, overlayLevel );
vertStore.put( uri, vertex );
}
return vertStore.get( uri );
}
示例5: createOrRetrieveEdge
import org.openrdf.model.URI; //导入方法依赖的package包/类
protected SEMOSSEdge createOrRetrieveEdge( URI edgeKey, SEMOSSVertex src,
SEMOSSVertex dst, int overlayLevel ) {
URI uri = new URIImpl( edgeKey.stringValue() );
String key = getEdgeKey( edgeKey, src, dst );
if ( !edgeStore.containsKey( key ) ) {
SEMOSSEdge edge = createEdge( src, dst, uri );
level.put( edge, overlayLevel );
edgeStore.put( key, edge );
}
return edgeStore.get( key );
}
示例6: getEdgeKey
import org.openrdf.model.URI; //导入方法依赖的package包/类
protected final String getEdgeKey( URI edge, URI src, URI dst ) {
return edge.stringValue() + src + dst;
}
示例7: fromURI
import org.openrdf.model.URI; //导入方法依赖的package包/类
/**
* Convert an RDF URI (element id/label or property key) back into a string.
*
* @param uri
* RDF representation of an element id/label or property key
* @return
* property graph (string) representation
*/
default String fromURI(final URI uri) {
final String s = uri.stringValue();
return s.substring(s.lastIndexOf(':')+1);
}