本文整理汇总了Java中org.apache.jena.rdf.model.impl.ResourceImpl类的典型用法代码示例。如果您正苦于以下问题:Java ResourceImpl类的具体用法?Java ResourceImpl怎么用?Java ResourceImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResourceImpl类属于org.apache.jena.rdf.model.impl包,在下文中一共展示了ResourceImpl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IndexRequestProcessorForTPFs
import org.apache.jena.rdf.model.impl.ResourceImpl; //导入依赖的package包/类
/**
*
* @param baseUrl
* @param datasources
*/
public IndexRequestProcessorForTPFs(
final String baseUrl,
final HashMap<String, IDataSource> datasources )
{
this.model = ModelFactory.createDefaultModel();
for (Map.Entry<String, IDataSource> entry : datasources.entrySet()) {
String datasourceName = entry.getKey();
IDataSource datasource = entry.getValue();
Resource datasourceUrl = new ResourceImpl(baseUrl + "/" + datasourceName);
model.add(datasourceUrl, new PropertyImpl(RDF + "type"), VOID + "Dataset");
model.add(datasourceUrl, new PropertyImpl(RDFS + "label"), datasource.getTitle());
model.add(datasourceUrl, new PropertyImpl(DC + "title"), datasource.getTitle());
model.add(datasourceUrl, new PropertyImpl(DC + "description"), datasource.getDescription());
}
}
示例2: main
import org.apache.jena.rdf.model.impl.ResourceImpl; //导入依赖的package包/类
public static void main(final String args[]) {
final Set<String> classes = new HashSet<>();
classes.add("<http://dbpedia.org/ontology/Person>");
classes.add("<http://dbpedia.org/ontology/Place>");
classes.add("<http://dbpedia.org/ontology/Organisation>");
// TripleSelector ts = new SimpleSummarySelector(classes, classes,
// "http://dbpedia.org/sparql", null);
final SemWeb2NLVerbalizer verbalizer = new SemWeb2NLVerbalizer(SparqlEndpoint.getEndpointDBpedia(), true, true);
final List<Statement> stmts = Arrays.asList(
new StatementImpl(new ResourceImpl("http://dbpedia.org/resource/Streaky_Bay,_South_Australia"),
new PropertyImpl("http://dbpedia.org/property/fedgov"),
new ResourceImpl("http://dbpedia.org/resource/Division_of_Grey")),
new StatementImpl(new ResourceImpl("http://dbpedia.org/resource/Streaky_Bay,_South_Australia"),
new PropertyImpl("http://dbpedia.org/property/location"),
new ResourceImpl("http://dbpedia.org/resource/Adelaide")),
new StatementImpl(new ResourceImpl("http://dbpedia.org/resource/Streaky_Bay,_South_Australia"),
new PropertyImpl("http://dbpedia.org/ontology/country"),
new ResourceImpl("http://dbpedia.org/resource/Australia")));
final Document doc = verbalizer.generateDocument(stmts);
System.out.println(doc);
// for (int i = 0; i <= 5; i++) {
// List<Statement> stmts = ts.getNextStatements();
// Document doc = verbalizer.generateDocument(stmts);
// System.out.println(doc);
// }
}