conjecto / easyspinrdf
使用卓越的 EasyRdf 实现的 SPIN
0.1.0-beta.1
2013-03-11 14:42 UTC
Requires
- php: >=5.2.8
- easyrdf/easyrdf: @dev
Requires (Dev)
- phpunit/phpunit: >=3.5.15
This package is not auto-updated.
Last update: 2024-09-14 14:30:21 UTC
README
使用卓越的 EasyRdf 实现 SPIN SPARQL 语法。
SPIN SPARQL 语法是 SPARQL 在 RDF 格式下的机器可读表示。这个 EasyRdf 扩展将 SPIN RDF 数据结构转换为有效的 SPARQL 查询字符串。
示例
以 ttl 格式表示的 RDF 图
my:query
a sp:Ask ;
sp:where (
[ sp:object sp:_age ;
sp:predicate my:age ;
sp:subject spin:_this
] [ a sp:Filter ;
sp:expression
[ sp:arg1 sp:_age ;
sp:arg2 18 ;
a sp:lt
]
] )
]
使用 EasyRdf 和 EasySpinRdf 获取相应的 SPARQL 查询
EasySpinRdf_Utils::setTypeMappers();
$graph = new EasyRdf_Graph("http://conjecto.com/queries.ttl");
$graph->load();
echo $graph->get("my:query")->getSparql();
结果
ASK WHERE {
?this my:age ?age .
FILTER (?age < 18) .
}
链接
- EasyRdf 主页
- 源代码: http://github.com/njh/easyspinrdf
- 问题跟踪器: http://github.com/njh/easyspinrdf/issues
- Conjecto 主页
待办事项
- 逆向工程
- 支持 SPIN 模型词汇表