• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MemValueFactory类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.openrdf.sail.memory.model.MemValueFactory的典型用法代码示例。如果您正苦于以下问题:Java MemValueFactory类的具体用法?Java MemValueFactory怎么用?Java MemValueFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MemValueFactory类属于org.openrdf.sail.memory.model包,在下文中一共展示了MemValueFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createWriter

点赞 3

import org.openrdf.sail.memory.model.MemValueFactory; //导入依赖的package包/类
private RDFWriter createWriter(StringWriter writer) {
	RDFWriter result=null;
	if(format.equals(Format.TURTLE)) {
		result=new TurtlePrettyPrinter(new MemValueFactory().createURI(baseURI.toString()),writer);
	} else {
		RDFWriterRegistry registry=RDFWriterRegistry.getInstance();
		RDFFormat rawFormat=Rio.getWriterFormatForMIMEType(format.getMime(),RDFFormat.RDFXML);
		RDFWriterFactory factory=registry.get(rawFormat);
		result=factory.getWriter(writer);
		if(format.equals(Format.JSON_LD)) {
			result.getWriterConfig().set(JSONLDSettings.JSONLD_MODE,JSONLDMode.FLATTEN);
			result.getWriterConfig().set(BasicWriterSettings.PRETTY_PRINT,true);
		}
	}
	return result;
}
 

开发者ID:ldp4j,
项目名称:ldp4j,
代码行数:17,
代码来源:RDFModelFormater.java

示例2: generateID

点赞 2

import org.openrdf.sail.memory.model.MemValueFactory; //导入依赖的package包/类
@Override
public Resource generateID(Set<URI> types) {
    if(types.contains(new MemValueFactory().createURI("http://www.w3.org/ns/prov/SoftwareAgent"))) {
        return new MemValueFactory().createURI("urn:SOFTWARE:" + UUID.randomUUID());
    } else {
        return new MemValueFactory().createURI("urn:CUSTOMURL:" + UUID.randomUUID());
    }
}
 

开发者ID:anno4j,
项目名称:anno4j,
代码行数:9,
代码来源:IDGeneratorTest.java

示例3: setUp

点赞 2

import org.openrdf.sail.memory.model.MemValueFactory; //导入依赖的package包/类
@Before
public void setUp() {
	vf = new MemValueFactory();
	outNoBase = new StringWriter();
	outWithBase = new StringWriter();
	noBase = new TurtlePrettyPrinter(outNoBase);
	withBase = new TurtlePrettyPrinter(vf.createURI(BASE),outWithBase);
}
 

开发者ID:ldp4j,
项目名称:ldp4j,
代码行数:9,
代码来源:TurtlePrettyPrinterTest.java

示例4: setUp

点赞 2

import org.openrdf.sail.memory.model.MemValueFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	vf=new MemValueFactory();
	namespaces=new HashMap<String, String>();
	namespaces.put("sav", "http://www.megatwork.org/vocabulary#");
	namespaces.put("saw", BASE);
	sut = new TurtleValueUtils(vf.createURI(BASE),namespaces);
}
 

开发者ID:ldp4j,
项目名称:ldp4j,
代码行数:9,
代码来源:TurtleValueUtilsTest.java

示例5: TripleFormater

点赞 2

import org.openrdf.sail.memory.model.MemValueFactory; //导入依赖的package包/类
public TripleFormater(URI baseURI) {
	this.baseURI = baseURI;
	this.valueFactory = new MemValueFactory();
	this.subjectFormater = new SubjectFormater();
	this.objectFormater = new ObjectFormater();
}
 

开发者ID:ldp4j,
项目名称:ldp4j,
代码行数:7,
代码来源:RDFModelFormater.java

示例6: generateID

点赞 1

import org.openrdf.sail.memory.model.MemValueFactory; //导入依赖的package包/类
/**
 * Generates a unique resource with an urn:anno4j prefix.
 * @return a Resource containing a unique identifier.
 * @param types
 */
@Override
public Resource generateID(Set<URI> types) {
    return new MemValueFactory().createURI("urn:anno4j:" + UUID.randomUUID());
}
 

开发者ID:anno4j,
项目名称:anno4j,
代码行数:10,
代码来源:IDGeneratorAnno4jURN.java

示例7: generateID

点赞 1

import org.openrdf.sail.memory.model.MemValueFactory; //导入依赖的package包/类
/**
 * Generates a unique resource with an
 * http://lifewatchgreece.eu/entity/annotations/resources/ prefix.
 *
 * @return a Resource containing a unique identifier.
 */
@Override
public Resource generateID(Set<URI> set) {
    // In any case, i.e. whatever the set contains just return lifewatch randomUUID
    return new MemValueFactory().createURI("http://lifewatchgreece.eu/entity/annotations/resources/" + UUID.randomUUID());
}
 

开发者ID:isl,
项目名称:LifeWatch_Greece,
代码行数:12,
代码来源:URIGenerator.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)