当前位置: 首页>>代码示例>>Java>>正文


Java Statement.toString方法代码示例

本文整理汇总了Java中org.openrdf.model.Statement.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Statement.toString方法的具体用法?Java Statement.toString怎么用?Java Statement.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openrdf.model.Statement的用法示例。


在下文中一共展示了Statement.toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: accept

import org.openrdf.model.Statement; //导入方法依赖的package包/类
@Override
public boolean accept(Statement stmt) {
    lastCause="No error";
    if(unacceptableProperties != null && unacceptableProperties.length > 0){
        String predicate = stmt.getPredicate().stringValue();
        for(String s : unacceptableProperties){
            if(s.equals(predicate)){
                lastCause = "Property "+predicate+ " of statement "+stmt.toString()+" present in black list.";
                return false;
            }
        }
        return true;
    }
    else{
        return true;
    }
}
 
开发者ID:linked-swissbib,项目名称:reshaperdf,代码行数:18,代码来源:BlackListPropertyFilter.java

示例2: accept

import org.openrdf.model.Statement; //导入方法依赖的package包/类
@Override
public boolean accept(Statement stmt) {
    lastCause="No error";
    if(acceptableProperties != null && acceptableProperties.length > 0){
        String predicate = stmt.getPredicate().stringValue();
        for(String s : acceptableProperties){
            if(s.equals(predicate)){
                return true;
            }
        }
        lastCause = "Property "+predicate+ " of statement "+stmt.toString()+" not in white list.";
        return false;
    }
    else{
        return true;
    }
}
 
开发者ID:linked-swissbib,项目名称:reshaperdf,代码行数:18,代码来源:WhiteListPropertyFilter.java

示例3: getGeometry

import org.openrdf.model.Statement; //导入方法依赖的package包/类
/**
 * Parse GML/wkt literal to Geometry
 *
 * @param statement
 * @return
 * @throws ParseException
 * @throws ParserConfigurationException
 * @throws SAXException
 * @throws IOException
 */
public static Geometry getGeometry(final Statement statement, GmlToGeometryParser gmlToGeometryParser) throws ParseException {
    // handle GML or WKT
    final Literal lit = getLiteral(statement);
    if (GeoConstants.XMLSCHEMA_OGC_WKT.equals(lit.getDatatype())) {
        final String wkt = lit.getLabel().toString();
        return (new WKTReader()).read(wkt);
    } else if (GeoConstants.XMLSCHEMA_OGC_GML.equals(lit.getDatatype())) {
        final String gml = lit.getLabel().toString();
        try {
            return getGeometryGml(gml, gmlToGeometryParser);
        } catch (IOException | SAXException | ParserConfigurationException e) {
            throw new ParseException(e);
        }
    } else {
        throw new ParseException("Literal is unknown geo type, expecting WKT or GML: " + statement.toString());
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:28,代码来源:GeoParseUtils.java

示例4: getLiteral

import org.openrdf.model.Statement; //导入方法依赖的package包/类
public static Literal getLiteral(final Statement statement) throws ParseException {
    final org.openrdf.model.Value v = statement.getObject();
    if (!(v instanceof Literal)) {
        throw new ParseException("Statement does not contain Literal: " + statement.toString());
    }
    final Literal lit = (Literal) v;
    return lit;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:9,代码来源:GeoParseUtils.java

示例5: rollingCacheContains

import org.openrdf.model.Statement; //导入方法依赖的package包/类
/**
 * keeps track of the most recent 1000 statements and returns true if the input statement is in
 * the cache
 * 
 * @param stmt
 * @return
 */
private boolean rollingCacheContains(Statement stmt) {
	String stmtStr = stmt.toString();
	if (rollingCacheSet.contains(stmtStr)) {
		return true;
	}
	int currentSize = rollingCacheList.size();
	if (currentSize >= ROLLING_CACHE_MAX_SIZE) {
		String removed = rollingCacheList.removeLast();
		rollingCacheSet.remove(removed);
	}
	rollingCacheSet.add(stmtStr);
	rollingCacheList.addFirst(stmtStr);
	return false;
}
 
开发者ID:UCDenver-ccp,项目名称:datasource,代码行数:22,代码来源:RdfRecordWriterImpl.java


注:本文中的org.openrdf.model.Statement.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。