本文整理匯總了Java中org.apache.jena.rdf.model.RDFNode.as方法的典型用法代碼示例。如果您正苦於以下問題:Java RDFNode.as方法的具體用法?Java RDFNode.as怎麽用?Java RDFNode.as使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.jena.rdf.model.RDFNode
的用法示例。
在下文中一共展示了RDFNode.as方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toXML
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public boolean toXML(Element e, RDFNode rdf, Context ctx) {
boolean ok =true;
try {
schema xsd = (schema) this.get_owner();
simpleType t = get_type(ctx);
String type = null;
if (t==null) type = expandQName(ctx.getDefaultNS(),itemType, ctx.getModel());
RDFList list = (RDFList) rdf.as(RDFList.class);
String pack = null;
for (ExtendedIterator i = list.iterator(); ok && i.hasNext(); ) {
RDFNode n = (RDFNode) i.next();
if (t!=null) ok=t.toXML(e,n,pack,ctx);
else ok=xsd.toXMLText(e,n,type,pack,ctx);
pack = " "; // whitespace separator
}
} catch (Exception ex) { // non-fatal
Gloze.logger.warn("failed to list value");
}
return ok;
}
示例2: toXMLText
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public boolean toXMLText(Element element, RDFNode rdf, String type, String pack, Context ctx) {
String v;
Document doc = element.getOwnerDocument();
simpleType s = ctx.getSimpleType(type);
if (s!=null) return s.toXML(element,rdf,pack,ctx);
if (type!=null && type.equals(XSD_URI+"#IDREFS") && rdf instanceof Resource
&& ((Resource)rdf).hasProperty(RDF.first)
&& rdf.canAs(RDFList.class)) {
RDFList l = (RDFList) rdf.as(RDFList.class);
for (ExtendedIterator i=l.iterator(); i.hasNext();) {
v = toXMLValue(element, (RDFNode) i.next(), XSD.IDREF.getURI(), ctx);
if (v==null) return false; // failed for this type
element.appendChild(doc.createTextNode(pack==null?v:pack+v));
pack = " ";
}
return true;
}
String val = toXMLValue(element, rdf, type, ctx);
if (val!=null) {
element.appendChild(doc.createTextNode(pack==null?val:pack+val));
return true;
}
return false;
}
示例3: listStatements
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static void listStatements(Collection<Statement> result, Model model, RDFNode sourceVertex, RDFNode predicate, RDFNode targetVertex) {
if(sourceVertex != null && !sourceVertex.isURIResource()) {
result = Collections.emptySet();
} else if(predicate != null && predicate.canAs(Property.class)) {
result = Collections.emptySet();
} else {
Resource s = sourceVertex == null ? null : sourceVertex.asResource();
Property p = predicate == null ? null : predicate.as(Property.class);
result = model.listStatements(s, p, targetVertex).toSet();
}
}
示例4: asConstraintComponent
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHConstraintComponent asConstraintComponent(RDFNode resource) {
return resource.as(SHConstraintComponent.class);
}
示例5: asJSConstraint
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHJSConstraint asJSConstraint(RDFNode node) {
return node.as(SHJSConstraint.class);
}
示例6: asSPARQLFunction
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHSPARQLFunction asSPARQLFunction(RDFNode resource) {
return resource.as(SHSPARQLFunction.class);
}
示例7: asParameter
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameter asParameter(RDFNode resource) {
return resource.as(SHParameter.class);
}
示例8: asParameterizable
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameterizable asParameterizable(RDFNode resource) {
return resource.as(SHParameterizable.class);
}
示例9: asPropertyShape
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHPropertyShape asPropertyShape(RDFNode node) {
return node.as(SHPropertyShape.class);
}
示例10: asNodeShape
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHNodeShape asNodeShape(RDFNode node) {
return node.as(SHNodeShape.class);
}
示例11: asSPARQLConstraint
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHSPARQLConstraint asSPARQLConstraint(RDFNode node) {
return node.as(SHSPARQLConstraint.class);
}
示例12: asSPARQLTarget
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHSPARQLTarget asSPARQLTarget(RDFNode node) {
return node.as(SHSPARQLTarget.class);
}
示例13: asTemplateCall
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameterizableInstance asTemplateCall(RDFNode resource) {
return resource.as(SHParameterizableInstance.class);
}
示例14: asParameterizableTarget
import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameterizableTarget asParameterizableTarget(RDFNode node) {
return node.as(SHParameterizableTarget.class);
}