• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StatementImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: expandSubClasses

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private List<Statement> expandSubClasses(Model model){
	List<Statement> stmts = new ArrayList<Statement>();
	
	
	String sparql = "PREFIX rdfs: <" + RDFS.getURI() + ">"
			+ "SELECT DISTINCT ?class ?synonym "
			+ "WHERE { "
			+ "?class rdfs:subClassOf+ ?subClass . "
			+ "?subClass <" + synonym + "> ?synonym"
			+ "}";
	
	Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
	QueryExecution queryExecution = QueryExecutionFactory.create(query, model);
	ResultSet resultSet = queryExecution.execSelect();
	resultSet.forEachRemaining(querySolution -> {
		stmts.add(new StatementImpl(querySolution.getResource("class"), synonym, querySolution.getLiteral("synonym")));
	});
	return stmts;
}
 
开发者ID:teamdigitale,项目名称:ontonethub,代码行数:20,代码来源:IndexingJob.java


示例2: expandSubProperties

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private List<Statement> expandSubProperties(Model model){
	List<Statement> stmts = new ArrayList<Statement>();
	
	String sparql = "PREFIX rdfs: <" + RDFS.getURI() + ">"
			+ "SELECT DISTINCT ?property ?synonym "
			+ "WHERE { "
			+ "?property rdfs:subPropertyOf+ ?subProperty . "
			+ "?subProperty <" + synonym + "> ?synonym"
			+ "}";
	
	Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
	QueryExecution queryExecution = QueryExecutionFactory.create(query, model);
	ResultSet resultSet = queryExecution.execSelect();
	resultSet.forEachRemaining(querySolution -> {
		stmts.add(new StatementImpl(querySolution.getResource("property"), synonym, querySolution.getLiteral("synonym")));
	});
	return stmts;
}
 
开发者ID:teamdigitale,项目名称:ontonethub,代码行数:19,代码来源:IndexingJob.java


示例3: createQualityReport

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
/**
 * Create instance triples corresponding towards a Quality Report
 * 
 * @param computedOn - The resource URI of the dataset computed on
 * @param problemReport - A list of quality problem as RDF Jena models
 * 
 * @return A Jena Model which can be queried or stored
 */
public Model createQualityReport(Resource computedOn, List<String> problemReportModels){
	Model m = dataset.getDefaultModel();
	
	Resource reportURI = Commons.generateURI();
	m.add(new StatementImpl(reportURI, RDF.type, QPRO.QualityReport));
	m.add(new StatementImpl(reportURI, QPRO.computedOn, computedOn));
	for(String prModelURI : problemReportModels){
		Model prModel = getProblemReportFromTBD(prModelURI);
		for(Resource r : getProblemURI(prModel)){
			m.add(new StatementImpl(reportURI, QPRO.hasProblem, r));
		}
		m.add(prModel);
		dataset.removeNamedModel(prModelURI);
	}
	return m;
}
 
开发者ID:EIS-Bonn,项目名称:Luzzu,代码行数:25,代码来源:QualityReport.java


示例4: createViolatingTriple

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private void createViolatingTriple(Statement stmt, String resource){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource);
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, DQMPROB.ViolatingTriple));
	
	RDFNode violatedTriple = Commons.generateRDFBlankNode();
	m.add(new StatementImpl(violatedTriple.asResource(), RDF.type, RDF.Statement));
	m.add(new StatementImpl(violatedTriple.asResource(), RDF.subject, stmt.getSubject()));
	m.add(new StatementImpl(violatedTriple.asResource(), RDF.predicate, stmt.getPredicate()));
	m.add(new StatementImpl(violatedTriple.asResource(), RDF.object, stmt.getObject()));
	
	m.add(new StatementImpl(subject, DQMPROB.hasViolatingTriple, violatedTriple));

	this._problemList.add(m);
}
 
开发者ID:diachron,项目名称:quality,代码行数:17,代码来源:EstimatedDereferenceabilityForwardLinks.java


示例5: getUsage

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private List<Statement> getUsage(Property property, Model model){
	
	List<Statement> stmts = new ArrayList<Statement>();
	String sparql = "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "
			+ "PREFIX owl: <http://www.w3.org/2002/07/owl#> "
			+ "SELECT DISTINCT ?concept "
			+ "WHERE{"
			+ "  {<" + property.getURI() + "> rdfs:domain ?concept} "
			+ "  UNION "
			+ "  { "
			+ "    ?concept rdfs:subClassOf|owl:equivalentClass ?restriction . "
			+ "    ?restriction a owl:Restriction; "
			+ "      owl:onProperty <" + property.getURI() + "> "
			+ "  } "
			+ "}";
	Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
	QueryExecution queryExecution = QueryExecutionFactory.create(query, model);
	
	ResultSet resultSet = queryExecution.execSelect();
	while(resultSet.hasNext()){
		QuerySolution querySolution = resultSet.next();
		Resource concept = querySolution.getResource("concept");
		
		stmts.add(new StatementImpl(property, usage, concept));
	}
	
	return stmts;
	
}
 
开发者ID:teamdigitale,项目名称:ontonethub,代码行数:30,代码来源:IndexingJob.java


示例6: getIdFromDBpedia

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
/**
 * The Wikipedia Id or -1 if the Id couldn't be retrieved.
 * 
 * FIXME The method throws an exception for "http://DBpedia.org/resource/Origin_of_the_name_"Empire_State"". this
 * might be happen because of the quotes inside the URI.
 * 
 * @param dbpediaUri
 * @return
 */
@Deprecated
public static int getIdFromDBpedia(String dbpediaUri) {
    int id = -1;
    ParameterizedSparqlString query = new ParameterizedSparqlString(
            "SELECT ?id WHERE { ?dbpedia dbo:wikiPageID ?id .}", prefixes);
    query.setIri("dbpedia", dbpediaUri);
    QueryExecution qexec = null;
    try {
        qexec = QueryExecutionFactory.create(query.asQuery(),
                model);
    } catch (QueryParseException e) {
        LOGGER.error("Got a bad dbpediaUri \"" + dbpediaUri
                + "\" which couldn't be parse inside of a SPARQL query. Returning -1.", e);
        return id;
    }
    ResultSet result = qexec.execSelect();
    if (result.hasNext()) {
        id = result.next().get("id").asLiteral().getInt();
        return id;
    }
    qexec = QueryExecutionFactory.sparqlService(
            "http://dbpedia.org/sparql", query.asQuery());
    result = qexec.execSelect();
    if (result.hasNext()) {
        id = result.next().get("id").asLiteral().getInt();
        model.add(new StatementImpl(model.createResource(dbpediaUri), model
                .createProperty("http://dbpedia.org/ontology/wikiPageID"),
                model.createTypedLiteral(id)));
        return id;
    }

    model.add(new StatementImpl(model.createResource(dbpediaUri), model
            .createProperty("http://dbpedia.org/ontology/wikiPageID"),
            model.createTypedLiteral(id)));
    return id;
}
 
开发者ID:dice-group,项目名称:gerbil,代码行数:46,代码来源:DBpediaToWikiId.java


示例7: startTopology

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
public void startTopology(Model returnModel){
  
  ResIterator resIterator = this.createModel.listResourcesWithProperty(Omn.hasResource);
  while(resIterator.hasNext()){
    Resource resource = resIterator.nextResource();
    Property property = returnModel.createProperty(Omn_lifecycle.hasState.getNameSpace(),Omn_lifecycle.hasState.getLocalName());
    property.addProperty(RDF.type, OWL.FunctionalProperty);
    Statement statement = new StatementImpl(resource, property, Omn_lifecycle.Started);
    returnModel.add(statement);
  }
}
 
开发者ID:FITeagle,项目名称:adapters,代码行数:12,代码来源:CallOpenSDNcore.java


示例8: extendResourcesProperties

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
public void extendResourcesProperties(Model returnModel, Model resultModel){
  
  StmtIterator statementIterator_createModel = this.createModel.listStatements(new SimpleSelector((Resource)null, Omn.hasResource, (Object)null));
  
  while(statementIterator_createModel.hasNext()){
    
    Statement requestedResourceStatement = statementIterator_createModel.nextStatement();
    Resource requestedResource = requestedResourceStatement.getObject().asResource();
    String resource_id = this.createModel.getRequiredProperty(requestedResource, Omn_lifecycle.hasID).getString();
    Resource resourceProperties = this.createModel.getResource(requestedResource.getURI());
    
    StmtIterator stmtIterator = resultModel.listStatements(new SimpleSelector((Resource)null, Omn_lifecycle.hasID, (Object) resource_id));
    while(stmtIterator.hasNext()){
      Statement statement = stmtIterator.nextStatement();
      Resource createdResource = statement.getSubject();
      
      StmtIterator stmtIter = resultModel.listStatements(new SimpleSelector(createdResource, (Property)null, (RDFNode)null));
      
      while(stmtIter.hasNext()){
        Statement createdStatement = stmtIter.nextStatement();
        
        if(!resourceProperties.hasProperty(createdStatement.getPredicate(), createdStatement.getObject())){
        Statement stmt = new StatementImpl(requestedResource, createdStatement.getPredicate(), createdStatement.getObject());
        returnModel.add(stmt);
        }
      }
    }
  } 
}
 
开发者ID:FITeagle,项目名称:adapters,代码行数:30,代码来源:CallOpenSDNcore.java


示例9: initialize

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
@Before
public void initialize(){
  Model dummyModel = ModelFactory.createDefaultModel();
  Resource adapterType = dummyModel.createResource("adapter type");
  Statement dummyStatement = new StatementImpl(adapterType, RDFS.subClassOf, MessageBusOntologyModel.classAdapter);
  dummyModel.add(dummyStatement);
  Resource resource = dummyModel.createResource("dummy resource");
  adapter = new ToscaAdapter(dummyModel, resource, null);
  callOpenSDNcore = new CallOpenSDNcore(dummyModel, adapter);
}
 
开发者ID:FITeagle,项目名称:adapters,代码行数:11,代码来源:ToscaAdapterTest.java


示例10: PartialStatement

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
/** Creates a partial statement from a partial triplet (subject, predicate, object).
 * 
 * At least one of the parameter is assumed to be null.
 * 
 * @param subject The subject of the statement
 * @param predicate The predicate of the statement
 * @param object The object of the statement
 * @param model The ontology this partial statement refers to.
 */
public PartialStatement(Resource subject, Property predicate, RDFNode object, ModelCom model) {
	
	stmtTokens = new ArrayList<String>();
	
	if (subject == null) {
		stmtTokens.add("?subject");
		subject = model.createResource("nullSubject");
	}
	else
		stmtTokens.add(Namespaces.toLightString(subject));
	
	if (predicate == null) {
		stmtTokens.add("?predicate");
		predicate = model.createProperty("nullPredicate");
	}
	else
		stmtTokens.add(Namespaces.toLightString(predicate));
	
	if (object == null) {
		stmtTokens.add("?object");
		object = model.createResource("nullObject");
	}
	else
		stmtTokens.add(Namespaces.toLightString(object));
	
	baseStmt = new StatementImpl(subject, predicate, object, model);
}
 
开发者ID:severin-lemaignan,项目名称:oro-server,代码行数:37,代码来源:PartialStatement.java


示例11: createProblemModel

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private void createProblemModel(String resource, String expectedContentType, String actualContentType){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource);
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, DQMPROB.MisreportedTypeException));
	m.add(new StatementImpl(subject, DQMPROB.expectedContentType, m.createLiteral(expectedContentType)));
	m.add(new StatementImpl(subject, DQMPROB.actualContentType, m.createLiteral(actualContentType)));
	
	this._problemList.add(m);
}
 
开发者ID:diachron,项目名称:quality,代码行数:11,代码来源:MisreportedContentType.java


示例12: createNotValidForwardLink

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private void createNotValidForwardLink(String resource){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource);
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, DQMPROB.NotValidForwardLink));
	
	this._problemList.add(m);
}
 
开发者ID:diachron,项目名称:quality,代码行数:9,代码来源:DereferenceabilityForwardLinks.java


示例13: createProblemModel

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private void createProblemModel(String resource, String expectedContentType, String actualContentType){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource);
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, DQMPROB.MisreportedTypeException));
	if ((expectedContentType == null) || (expectedContentType.equals("")))
		m.add(new StatementImpl(subject, DQMPROB.expectedContentType, m.createLiteral("Unknown Expected Content Type")));
	else m.add(new StatementImpl(subject, DQMPROB.expectedContentType, m.createLiteral(expectedContentType)));
	if ((actualContentType == null) || (actualContentType.equals("")))
		m.add(new StatementImpl(subject, DQMPROB.actualContentType, m.createLiteral("Unknown Content Type")));
	else 
		m.add(new StatementImpl(subject, DQMPROB.actualContentType, m.createLiteral(actualContentType)));
	this._problemList.add(m);
}
 
开发者ID:diachron,项目名称:quality,代码行数:15,代码来源:EstimatedMisreportedContentTypeByStratified.java


示例14: createNotValidBacklink

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private void createNotValidBacklink(String resource){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource);
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, DQMPROB.NotValidDereferenceableBackLink));
	
	this._problemList.add(m);
}
 
开发者ID:diachron,项目名称:quality,代码行数:9,代码来源:DereferenceBackLinks.java


示例15: createNotValidBackLink

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
private void createNotValidBackLink(String resource){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource);
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, DQMPROB.NotValidDereferenceableBackLink));
	
	this._problemList.add(m);
}
 
开发者ID:diachron,项目名称:quality,代码行数:9,代码来源:EstimatedDereferenceBackLinks.java


示例16: createProblemModel

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
List<Statement> createProblemModel(){
	List<Statement> lst = new ArrayList<Statement>();
   	Resource anon = ModelFactory.createDefaultModel().createResource(AnonId.create());
   	
   	lst.add(new StatementImpl(anon, RDF.subject, Commons.asRDFNode(q.getSubject())));
   	lst.add(new StatementImpl(anon, RDF.predicate, Commons.asRDFNode(q.getPredicate())));
   	lst.add(new StatementImpl(anon, RDF.object, Commons.asRDFNode(q.getObject())));
   	
   	return lst;
}
 
开发者ID:diachron,项目名称:quality,代码行数:11,代码来源:CompatibleDatatype.java


示例17: createProblemModel

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
Model createProblemModel(){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource.toString());
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, DQMPROB.MultiTypedResourceWithDisjointedClasses));
	
	for(String s : setView){
		m.add(new StatementImpl(subject, DQMPROB.violatingDisjoinedClass, m.createResource(s)));
	}

	return m;
}
 
开发者ID:diachron,项目名称:quality,代码行数:13,代码来源:AdvancedEntitiesAsMembersOfDisjointClasses.java


示例18: createProblemModel

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
Model createProblemModel(){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource.toString());
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, type));
	
	if (type.equals(DQMPROB.MisplacedClass))
		m.add(new StatementImpl(subject, DQMPROB.hasMisplacedClass, m.asRDFNode(classOrProperty)));		
	else
		m.add(new StatementImpl(subject, DQMPROB.hasMisplacedProperty, m.asRDFNode(classOrProperty)));		
	

	return m;
}
 
开发者ID:diachron,项目名称:quality,代码行数:15,代码来源:MisplacedClassesOrProperties.java


示例19: createProblemModel

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
Model createProblemModel(){
	Model m = ModelFactory.createDefaultModel();
	
	Resource subject = m.createResource(resource.toString());
	m.add(new StatementImpl(subject, QPRO.exceptionDescription, type));
	
	if (type.equals(DQMPROB.MisusedDatatypeProperty))
		m.add(new StatementImpl(subject, DQMPROB.hasMisusedDatatypeProperty, m.asRDFNode(property)));		
	else
		m.add(new StatementImpl(subject, DQMPROB.hasMisusedObjectProperty, m.asRDFNode(property)));		
	

	return m;
}
 
开发者ID:diachron,项目名称:quality,代码行数:15,代码来源:MisusedOwlDatatypeOrObjectProperties.java


示例20: getProblemQuad

import com.hp.hpl.jena.rdf.model.impl.StatementImpl; //导入依赖的package包/类
Statement getProblemQuad(){
	Statement s = new StatementImpl(Commons.asRDFNode(q.getSubject()).asResource(),
	ModelFactory.createDefaultModel().createProperty(q.getPredicate().getURI()),
	Commons.asRDFNode(q.getObject())
	);
   	
   	
   	return s;
}
 
开发者ID:diachron,项目名称:quality,代码行数:10,代码来源:ShortURIs.java



注:本文中的com.hp.hpl.jena.rdf.model.impl.StatementImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TByteCollection类代码示例发布时间:2022-05-22
下一篇:
Java EncryptResult类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap