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


Java RDFNode.as方法代碼示例

本文整理匯總了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;
}
 
開發者ID:stevebattle,項目名稱:Gloze,代碼行數:22,代碼來源:list.java

示例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;
}
 
開發者ID:stevebattle,項目名稱:Gloze,代碼行數:27,代碼來源:schema.java

示例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();
        }

    }
 
開發者ID:SmartDataAnalytics,項目名稱:SubgraphIsomorphismIndex,代碼行數:15,代碼來源:PseudoGraphJenaModel.java

示例4: asConstraintComponent

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHConstraintComponent asConstraintComponent(RDFNode resource) {
	return resource.as(SHConstraintComponent.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例5: asJSConstraint

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHJSConstraint asJSConstraint(RDFNode node) {
	return node.as(SHJSConstraint.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例6: asSPARQLFunction

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHSPARQLFunction asSPARQLFunction(RDFNode resource) {
	return resource.as(SHSPARQLFunction.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例7: asParameter

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameter asParameter(RDFNode resource) {
	return resource.as(SHParameter.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例8: asParameterizable

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameterizable asParameterizable(RDFNode resource) {
	return resource.as(SHParameterizable.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例9: asPropertyShape

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHPropertyShape asPropertyShape(RDFNode node) {
	return node.as(SHPropertyShape.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例10: asNodeShape

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHNodeShape asNodeShape(RDFNode node) {
	return node.as(SHNodeShape.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例11: asSPARQLConstraint

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHSPARQLConstraint asSPARQLConstraint(RDFNode node) {
	return node.as(SHSPARQLConstraint.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例12: asSPARQLTarget

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHSPARQLTarget asSPARQLTarget(RDFNode node) {
	return node.as(SHSPARQLTarget.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例13: asTemplateCall

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameterizableInstance asTemplateCall(RDFNode resource) {
	return resource.as(SHParameterizableInstance.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java

示例14: asParameterizableTarget

import org.apache.jena.rdf.model.RDFNode; //導入方法依賴的package包/類
public static SHParameterizableTarget asParameterizableTarget(RDFNode node) {
	return node.as(SHParameterizableTarget.class);
}
 
開發者ID:TopQuadrant,項目名稱:shacl,代碼行數:4,代碼來源:SHFactory.java


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