当前位置: 首页>>代码示例>>Java>>正文


Java Model.containsResource方法代码示例

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


在下文中一共展示了Model.containsResource方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSupervisorOrganization

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
    * Add to the model the supervisor of the current Organization
    * 
    * @param Model the model we are currently working with
    * @param Resource the current organization
    * @param Organization the supervisor of the organization
    */
private void createSupervisorOrganization(Model model, Resource orgResource, Organization supervisor) {
	
	Resource supervisorResource = model.getResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber());
	
	if (model.containsResource(supervisorResource)) {
		orgResource.addProperty(Ontology.hasSupervisorOrganization, supervisorResource);
	} else {
		supervisorResource = model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(), Ontology.organizationResource);
           model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(), Ontology.businessEntityResource);
           model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(), Ontology.orgOrganizationResource);
           model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(), Ontology.registeredOrganizationResource);
           
           if (supervisor.getVatNumber() != "") {
           	supervisorResource.addLiteral(Ontology.vatId, supervisor.getVatNumber());
           } else {
           	supervisorResource.addLiteral(Ontology.vatId, "Empty vatID");
           }
           
           supervisorResource.addLiteral(Ontology.organizationId, supervisor.getUid());
           
           /** organization - Supervisor **/
		orgResource.addProperty(Ontology.hasSupervisorOrganization, supervisorResource);
	}
	
}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:33,代码来源:MonthlyRdfActions.java

示例2: createFekResource

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
    * Add to the model the the Fek that is related to the Organization
    * 
    * @param Model the model we are currently working with
    * @param Resource the resource of the related organization
    * @param String the issue type of the Fek 
    * @param String the year that Fek was published 
    * @param String the number of the Fek 
    */
private void createFekResource(Model model, Resource orgResource, String fekIssue, String fekYear, String fekNumber, boolean newOrganizationFlag) {
	
	String fekUriName = "";
	
	if ( (fekIssue != null) && (fekIssue != "") ) {
		fekUriName =  fekIssue + "/" + fekYear + "/" + fekNumber;
	} else {
		fekUriName = fekYear + "/" + fekNumber;
	}
	
	Resource fekResource = model.getResource(Ontology.instancePrefix  + "Fek/" + fekUriName);
	
	if (model.containsResource(fekResource)) { //if Fek resource exists use it
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	} else { //...else create it
		fekResource = model.createResource(Ontology.instancePrefix + "Fek/" + fekUriName, Ontology.fekResource);
		fekResource.addProperty(Ontology.fekNumber, fekNumber);
		fekResource.addProperty(Ontology.fekYear, fekYear);
		if ( (fekIssue != null) && (fekIssue != "") ) {
			fekResource.addProperty(Ontology.fekIssue, model.getResource(Ontology.instancePrefix + "FekType/" + fekIssue));
		}
	}
	
	/** Organization - FEK **/
	if (newOrganizationFlag) {
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	} else {
		orgResource.removeAll(Ontology.relatedFek); //delete the old relationships
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	}
	
}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:42,代码来源:MonthlyRdfActions.java

示例3: createFekResource

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the the Fek that is related to the Organization
 * 
 * @param Model
 *            the model we are currently working with
 * @param Resource
 *            the resource of the related organization
 * @param String
 *            the issue type of the Fek
 * @param String
 *            the year that Fek was published
 * @param String
 *            the number of the Fek
 */
private void createFekResource(Model model, Resource orgResource, String fekIssue, String fekYear, String fekNumber,
		boolean newOrganizationFlag) {

	String fekUriName = "";

	if ((fekIssue != null) && (fekIssue != "")) {
		fekUriName = fekIssue + "/" + fekYear + "/" + fekNumber;
	} else {
		fekUriName = fekYear + "/" + fekNumber;
	}

	Resource fekResource = model.getResource(Ontology.instancePrefix + "Fek/" + fekUriName);

	if (model.containsResource(fekResource)) { // if Fek resource exists use
												// it
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	} else { // ...else create it
		fekResource = model.createResource(Ontology.instancePrefix + "Fek/" + fekUriName, Ontology.fekResource);
		fekResource.addProperty(Ontology.fekNumber, fekNumber);
		fekResource.addProperty(Ontology.fekYear, fekYear);
		if ((fekIssue != null) && (fekIssue != "")) {
			fekResource.addProperty(Ontology.fekIssue,
					model.getResource(Ontology.instancePrefix + "FekType/" + fekIssue));
		}
	}

	/** Organization - FEK **/
	if (newOrganizationFlag) {
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	} else {
		orgResource.removeAll(Ontology.relatedFek); // delete the old
													// relationships
		orgResource.addProperty(Ontology.relatedFek, fekResource);
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:51,代码来源:MonthlyRdfActions.java

示例4: createSupervisorOrganization

import com.hp.hpl.jena.rdf.model.Model; //导入方法依赖的package包/类
/**
 * Add to the model the supervisor of the current Organization
 * 
 * @param Model
 *            the model we are currently working with
 * @param Resource
 *            the current organization
 * @param Organization
 *            the supervisor of the organization
 */
private void createSupervisorOrganization(Model model, Resource orgResource, Organization supervisor) {

	Resource supervisorResource = model
			.getResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber());

	if (model.containsResource(supervisorResource)) {
		orgResource.addProperty(Ontology.hasSupervisorOrganization, supervisorResource);
	} else {
		supervisorResource = model.createResource(
				Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.organizationResource);
		model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.businessEntityResource);
		model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.orgOrganizationResource);
		model.createResource(Ontology.instancePrefix + "Organization/" + supervisor.getVatNumber(),
				Ontology.registeredOrganizationResource);

		if (supervisor.getVatNumber() != "") {
			supervisorResource.addLiteral(Ontology.vatId, supervisor.getVatNumber());
		} else {
			supervisorResource.addLiteral(Ontology.vatId, "Empty vatID");
		}

		supervisorResource.addLiteral(Ontology.organizationId, supervisor.getUid());

		/** organization - Supervisor **/
		orgResource.addProperty(Ontology.hasSupervisorOrganization, supervisorResource);
	}

}
 
开发者ID:YourDataStories,项目名称:harvesters,代码行数:42,代码来源:MonthlyRdfActions.java


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