本文整理匯總了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);
}
示例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;
}
示例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);
}