當前位置: 首頁>>代碼示例>>Java>>正文


Java Resource.hasProperty方法代碼示例

本文整理匯總了Java中com.hp.hpl.jena.rdf.model.Resource.hasProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Resource.hasProperty方法的具體用法?Java Resource.hasProperty怎麽用?Java Resource.hasProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.hp.hpl.jena.rdf.model.Resource的用法示例。


在下文中一共展示了Resource.hasProperty方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: open

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
public Object open(Assembler ignore, Resource description, Mode ignore2) {
	if (!description.hasProperty(D2RQ.mappingFile)) {
		throw new D2RQException("Error in assembler specification " + description + ": missing property d2rq:mappingFile");
	}
	if (!description.getProperty(D2RQ.mappingFile).getObject().isURIResource()) {
		throw new D2RQException("Error in assembler specification " + description + ": value of d2rq:mappingFile must be a URI");
	}
	String mappingFileURI = ((Resource) description.getProperty(D2RQ.mappingFile).getObject()).getURI();
	String resourceBaseURI = null;
	Statement stmt = description.getProperty(D2RQ.resourceBaseURI);
	if (stmt != null) {
		if (!stmt.getObject().isURIResource()) {
			throw new D2RQException("Error in assembler specification " + description + ": value of d2rq:resourceBaseURI must be a URI");
		}
		resourceBaseURI = ((Resource) stmt.getObject()).getURI();
	}
	return new ModelD2RQ(mappingFileURI, resourceBaseURI);
}
 
開發者ID:d2rq,項目名稱:r2rml-kit,代碼行數:19,代碼來源:D2RQAssembler.java

示例2: findTemplateFile

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
public static File findTemplateFile(D2RServer server,
		Property fileConfigurationProperty) {
	Resource config = server.getConfig().findServerResource();
	if (config == null || !config.hasProperty(fileConfigurationProperty)) {
		return null;
	}
	String metadataTemplate = config.getProperty(fileConfigurationProperty)
			.getString();

	String templatePath;
	if (metadataTemplate.startsWith(File.separator)) {
		templatePath = metadataTemplate;
	} else {
		File mappingFile = new File(server.getConfig()
				.getLocalMappingFilename());
		String folder = mappingFile.getParent();
		if (folder != null) {
			templatePath = folder + File.separator + metadataTemplate;
		} else {
			templatePath = metadataTemplate;
		}

	}
	File f = new File(templatePath);
	return f;
}
 
開發者ID:aitoralmeida,項目名稱:c4a_data_repository,代碼行數:27,代碼來源:MetadataCreator.java

示例3: open

import com.hp.hpl.jena.rdf.model.Resource; //導入方法依賴的package包/類
public Object open(Assembler ignore, Resource description, Mode ignore2) {
	if (!description.hasProperty(D2RQ.mappingFile)) {
		throw new D2RQException("Error in assembler specification " + description + ": missing property d2rq:mappingFile");
	}
	if (!description.getProperty(D2RQ.mappingFile).getObject().isURIResource()) {
		throw new D2RQException("Error in assembler specification " + description + ": value of d2rq:mappingFile must be a URI");
	}
	String mappingFileURI = ((Resource) description.getProperty(D2RQ.mappingFile).getObject()).getURI();
	String resourceBaseURI = null;
	Statement stmt = description.getProperty(D2RQ.resourceBaseURI);
	if (stmt != null) {
		if (!stmt.getObject().isURIResource()) {
			throw new D2RQException("Error in assembler specification " + description + ": value of d2rq:resourceBaseURI must be a URI");
		}
		resourceBaseURI = ((Resource) stmt.getObject()).getURI();
	}
	return new ModelD2RQ(mappingFileURI, null, resourceBaseURI);
}
 
開發者ID:aitoralmeida,項目名稱:c4a_data_repository,代碼行數:19,代碼來源:D2RQAssembler.java


注:本文中的com.hp.hpl.jena.rdf.model.Resource.hasProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。