rdf-sparql 问题
我需要获取属于我的本体的 rdfs 文件的属性值..它有公里属性,其值为 12500.00..我需要获取这个值....在我的 rdfs 文件中没有 URI ....
任何人都可以告诉我如何做到这一点::::
i need to get the property value of the rdfs file which was belongs to my ontology..it has kilometer property and the value of it is 12500.00.. i need to get this value.... in my rdfs file there is no URI....
CAN ANY ONE SHOW ME THE WAY FOR DO THIS::::
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将
<...>
中的 URI 替换为词汇表中公里属性的实际 URI。哦,您是否尝试阅读 SPARQL 教程?
Replace the URI inside
<...>
with the actual URI of the kilometer property in your vocabulary.Oh and did you try reading a SPARQL tutorial?
如果您可以显示您尝试查询的数据示例,那么回答您的问题会容易得多。我可以假设您说“在我的 RDFS 文件中没有 URI”的两个原因:
http://...
URI。它们可能采用somePrefix:some-name
形式,在第一种情况下,这只是扩展前缀的情况。在第二种情况下,您必须构建一条从您可以识别(通过名称或其属性)的节点到您尝试查询的节点的查询路径。在这两种情况下都很容易做到,但很难抽象地解释 - 如果您显示实际数据,就会容易得多。
在评论中您问:“我怎样才能获得我的 RDF 文件的 URI?”。我将不得不再次猜测,但我假设您正在尝试通过程序中的 URI 引用本体文件(例如,将其加载到 Jena 模型中)。我能想到三种可能性:
你想要引用一个
file:
URI;例如,c:\User\fred\vocabs\foo.ttl
处的本体将为file:///c:/User/fred/vocabs/foo.ttl
,而/home/fred/vocabs/foo.txt
将为file:///home/fred/vocabs/foo.txt
。请注意,file:
前缀后面有三个正斜杠字符。您想通过本地 Apache 服务器或类似服务器引用该文件;如果您的本体位于
/home/fred/public_html/vocabs/foo.ttl
中,则 URI 将类似于http://localhost:8080/~fred/vocabs/foo.ttl
(详细信息可能会有所不同,具体取决于您设置服务器的方式)您将文件托管在 Joseki 中 实例或类似实例,在这种情况下,URI 将由您的 Joseki 配置确定,有关详细信息,请参阅 Joseki 文档。
It would be a lot easier to answer your question if you could show a sample of the data that you're trying to query. I can hypothesise two reasons why you say "in my RDFS file there is no URI":
http://...
URI's, for example they may be in the formsomePrefix:some-name
In the first case, it's simply a case of expanding the prefix. In the second case, you have to construct a path to query from a node you can identify (either by name, or by its properties) to the node you are trying to query. Easy to do in either case, but harder to explain in abstract - it will be much easier if you show your actual data.
In the comments you asked: "how can I get the URI of my RDF file?". Again I'm going to have to guess, but I presume that you are trying to reference your ontology file by URI in your program (e.g. to load it into a Jena model). There are three possibilities I can think of:
you want to reference a
file:
URI; for example the ontology atc:\User\fred\vocabs\foo.ttl
would befile:///c:/User/fred/vocabs/foo.ttl
, whereas/home/fred/vocabs/foo.txt
would befile:///home/fred/vocabs/foo.txt
. Note that there are three forward-slash characters after thefile:
prefix.you want to reference the file via a local Apache server or similar; if your ontology is in
/home/fred/public_html/vocabs/foo.ttl
then the URI would be something likehttp://localhost:8080/~fred/vocabs/foo.ttl
(details may vary depending on how you set up your server)you host the file in a Joseki instance or similar, in which case the URI will be determined by your Joseki configuration, see the Joseki documentation for details.