本文整理汇总了Java中com.hp.hpl.jena.rdf.model.impl.ModelCom类的典型用法代码示例。如果您正苦于以下问题:Java ModelCom类的具体用法?Java ModelCom怎么用?Java ModelCom使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelCom类属于com.hp.hpl.jena.rdf.model.impl包,在下文中一共展示了ModelCom类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: FileGraph
import com.hp.hpl.jena.rdf.model.impl.ModelCom; //导入依赖的package包/类
/**
Construct a new FileGraph who's name is given by the specified File,
If create is true, this is a new file, and any existing file will be destroyed;
if create is false, this is an existing file, and its current contents will
be loaded. The language code for the file is supplied.
@param f the File naming the associated file-system file
@param lang the language string for the file
@param create true to create a new one, false to read an existing one
@param strict true to throw exceptions for create: existing, open: not found
@param style the reification style for the graph
*/
public FileGraph( NotifyOnClose notify, File f, String lang, boolean create, boolean strict, ReificationStyle style )
{
super( style );
this.name = f;
this.notify = notify;
this.model = new ModelCom( this );
this.lang = lang;
if (create)
{ if (f.exists() && strict) throw new AlreadyExistsException( f.toString() ); }
else
readModel( this.model, strict );
}
开发者ID:jacekkopecky,项目名称:parkjam,代码行数:25,代码来源:FileGraph.java
示例2: PartialStatement
import com.hp.hpl.jena.rdf.model.impl.ModelCom; //导入依赖的package包/类
/** Creates a partial statement from a partial triplet (subject, predicate, object).
*
* At least one of the parameter is assumed to be null.
*
* @param subject The subject of the statement
* @param predicate The predicate of the statement
* @param object The object of the statement
* @param model The ontology this partial statement refers to.
*/
public PartialStatement(Resource subject, Property predicate, RDFNode object, ModelCom model) {
stmtTokens = new ArrayList<String>();
if (subject == null) {
stmtTokens.add("?subject");
subject = model.createResource("nullSubject");
}
else
stmtTokens.add(Namespaces.toLightString(subject));
if (predicate == null) {
stmtTokens.add("?predicate");
predicate = model.createProperty("nullPredicate");
}
else
stmtTokens.add(Namespaces.toLightString(predicate));
if (object == null) {
stmtTokens.add("?object");
object = model.createResource("nullObject");
}
else
stmtTokens.add(Namespaces.toLightString(object));
baseStmt = new StatementImpl(subject, predicate, object, model);
}
开发者ID:severin-lemaignan,项目名称:oro-server,代码行数:37,代码来源:PartialStatement.java
示例3: asResIterator
import com.hp.hpl.jena.rdf.model.impl.ModelCom; //导入依赖的package包/类
/**
* <p>Method that creates an iterator of resources</p>
* @param i - an iterator of resources as input
* @param m - the underlying model to use in the mapping
* @return a ResIterator
*/
public static ResIterator asResIterator( Iterator<Resource> i, final ModelCom m )
{
Map1<Resource, Resource> asResource = new Map1<Resource, Resource>()
{
public Resource map1( Resource o )
{ return (Resource) m.asRDFNode( o.asNode() ); }
};
return new ResIteratorImpl( WrappedIterator.create( i ).mapWith( asResource ), null );
}
开发者ID:vaibhavkhadilkar,项目名称:D2RQ-Update,代码行数:16,代码来源:ExtendedIteratorFactory.java
示例4: asRDFNodeIterator
import com.hp.hpl.jena.rdf.model.impl.ModelCom; //导入依赖的package包/类
/**
* <p>Method that creates an iterator of rdf nodes</p>
* @param i - an iterator of rdf nodes as input
* @param m - the underlying model to use in the mapping
* @return a NodeIterator
*/
static public NodeIterator asRDFNodeIterator( Iterator<RDFNode> i, final ModelCom m )
{
Map1<RDFNode, RDFNode> asRDFNode = new Map1<RDFNode, RDFNode>()
{
public RDFNode map1( RDFNode o )
{ return m.asRDFNode( o.asNode() ); }
};
return new NodeIteratorImpl( WrappedIterator.create( i ).mapWith( asRDFNode ), null );
}
开发者ID:vaibhavkhadilkar,项目名称:D2RQ-Update,代码行数:16,代码来源:ExtendedIteratorFactory.java
示例5: StatementPattern
import com.hp.hpl.jena.rdf.model.impl.ModelCom; //导入依赖的package包/类
public StatementPattern(Resource subject, Property predicate, RDFNode object, ModelCom model){
this(subject, predicate, object, model, false, false, false);
}
开发者ID:thermz,项目名称:OntoMapper,代码行数:4,代码来源:StatementsPair.java
示例6: createStatement
import com.hp.hpl.jena.rdf.model.impl.ModelCom; //导入依赖的package包/类
public Statement createStatement(String statement) throws IllegalStatementException {
Resource subject;
Property predicate;
RDFNode object;
List<String> tokens_statement = Helpers.tokenize(statement.trim(), ' ');
if (tokens_statement.size() != 3)
throw new IllegalStatementException(
"Three tokens are expected in a statement, " +
tokens_statement.size() + " found in " + statement + ".");
//expand the namespaces for subject and predicate.
for (int i = 0; i<2; i++){
tokens_statement.set(i, Namespaces.format(tokens_statement.get(i)));
}
subject = onto.getResource(tokens_statement.get(0));
predicate = onto.getProperty(tokens_statement.get(1));
//Handle objects
object = Helpers.parseLiteral(tokens_statement.get(2), (ModelCom)onto);
assert(object!=null);
Statement s =new StatementImpl(subject, predicate, object);
return s;
}
开发者ID:severin-lemaignan,项目名称:oro-server,代码行数:35,代码来源:OpenRobotsOntology.java
示例7: createPartialStatement
import com.hp.hpl.jena.rdf.model.impl.ModelCom; //导入依赖的package包/类
public PartialStatement createPartialStatement(String statement) throws IllegalStatementException {
PartialStatement p = new PartialStatement(statement, (ModelCom)getModel());
return p;
}
开发者ID:severin-lemaignan,项目名称:oro-server,代码行数:7,代码来源:OpenRobotsOntology.java
注:本文中的com.hp.hpl.jena.rdf.model.impl.ModelCom类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论