本文整理匯總了Java中org.apache.jena.rdf.model.Resource.getProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Resource.getProperty方法的具體用法?Java Resource.getProperty怎麽用?Java Resource.getProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.jena.rdf.model.Resource
的用法示例。
在下文中一共展示了Resource.getProperty方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getIntProperty
import org.apache.jena.rdf.model.Resource; //導入方法依賴的package包/類
public int getIntProperty(Model model, Resource res, String name) {
Property anIntProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#",name);
Statement aStatement = res.getProperty(anIntProperty);
if (aStatement != null) {
return aStatement.getObject().asLiteral().getInt();
}
return -1;
}
示例2: getBooleanProperty
import org.apache.jena.rdf.model.Resource; //導入方法依賴的package包/類
public boolean getBooleanProperty(Model model, Resource res, String name) {
Property aBooleanProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#",name);
Statement aStatement = res.getProperty(aBooleanProperty);
if (aStatement != null) {
return aStatement.getObject().asLiteral().getBoolean();
}
return false;
}
示例3: getStringProperty
import org.apache.jena.rdf.model.Resource; //導入方法依賴的package包/類
public String getStringProperty(Model model, Resource res, String name) {
Property aStringProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#",name);
Statement aStatement = res.getProperty(aStringProperty);
if (aStatement != null) {
return aStatement.getObject().asLiteral().getString();
}
return null;
}
示例4: setOffsetsRelativeTo
import org.apache.jena.rdf.model.Resource; //導入方法依賴的package包/類
public boolean setOffsetsRelativeTo() throws Exception {
if (resource==null)
return true;
Property hasOffsetProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#","hasOffset");
if (hasOffsetProperty != null) {
Statement hasOffsetStatement = resource.getProperty(hasOffsetProperty);
if (hasOffsetStatement != null) {
Resource offsetRes = hasOffsetStatement.getObject().asResource();
Property hasRelativeToProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#","relativeTo");
if (hasRelativeToProperty != null) {
Statement hasRelativeToStatement = offsetRes.getProperty(hasRelativeToProperty);
if (hasRelativeToStatement != null) {
Resource offsetsRelativeToRes = hasRelativeToStatement.getObject().asResource();
if (offsetsRelativeToRes == null)
throw new Exception(":Offset :relativeTo has no object");
for (Node sNode : csvTupler.getNodes()) {
if (sNode != this && sNode.getResource() != null) {
if (NodeFactory.resourcesEqual(sNode.getResource(), offsetsRelativeToRes)) {
offsetsRelativeTo = sNode;
rowOffset = offsetHasRow + offsetsRelativeTo.getRowOffset();
columnOffset = offsetHasCol + offsetsRelativeTo.getColumnOffset();
Iterator itr = getChildren().iterator();
while (itr.hasNext()) {
Node child = (Node)itr.next();
NodeFactory.setOffsets(child);
}
}
}
}
}
}
}
}
return true;
}
示例5: Node
import org.apache.jena.rdf.model.Resource; //導入方法依賴的package包/類
public Node(CsvTupler aCsvTupler, List<List<String>> theCsvRows, Model aModel, Resource aResource) {
constructed = false;
csvTupler = aCsvTupler;
csvRows = theCsvRows;
resource = aResource;
model = aModel;
parent = null;
offsetsAbsolute = false;
maxRow = 0;
maxCol = 0;
minRow = 999999;
minCol = 999999;
repeat = null;
offsetsRelativeTo = null;
isNotRelativeToImmediateParent = false;
Property nameProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#","name");
Statement nameStatement = resource.getProperty(nameProperty);
if (nameStatement != null) {
name = nameStatement.getObject().asLiteral().getString();
}
else {
name = null;
}
Property hasQueryProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#","hasQuery");
Statement hasQueryStatement = resource.getProperty(hasQueryProperty);
if (hasQueryStatement != null) {
Resource queryRes = hasQueryStatement.getObject().asResource();
query = getStringProperty(model, queryRes, "hasString");
}
else {
query = null;
}
rowOffset = 0;
columnOffset = 0;
Property hasOffsetProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#","hasOffset");
Statement hasOffsetStatement = resource.getProperty(hasOffsetProperty);
if (hasOffsetStatement != null) {
Resource offsetRes = hasOffsetStatement.getObject().asResource();
offsetsAbsolute = getBooleanProperty(model, offsetRes, "isAbsolute");
rowOffset = offsetHasRow = getIntProperty(model, offsetRes, "hasRow");
columnOffset = offsetHasCol = getIntProperty(model, offsetRes, "hasCol");
Property hasRelativeToProperty = model.getProperty("http://example.com/owl/csvtupler/map2sparql#","relativeTo");
if (hasRelativeToProperty != null) {
Statement hasRelativeToStatement = offsetRes.getProperty(hasRelativeToProperty);
if (hasRelativeToStatement != null) {
isNotRelativeToImmediateParent = true;
}
}
}
}