我怎样才能像原始文件一样保存我的 n3 文件格式
我用 c# 和 dotnetrdflibrery 编程'我有一个 n3 文件,我在 notpad 中打开它,并在下面显示它,
@prefix my: <http://www.codeproject.com/KB/recipes/n3_notation#>.
my:Peter a my:person, my:boy;
my:suffers my:acrophobia, my:insomnia, my:xenophobia;
my:name "Peter";
my:likes my:Kate.
my:Mark a my:person, my:boy;
my:suffers my:insomnia;
my:name "Mark".
my:Kate a my:person, my:girl;
my:name "Kate".
当我使用 g.savetofile() 保存此文件时,它以我不喜欢的格式保存它,我认为这没有良好的视图:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix my: <http://www.codeproject.com/KB/recipes/n3_notation#>.
<http://www.codeproject.com/KB/recipes/n3_notation#Kate> <http://www.codeproject.com/KB/recipes/n3_notation#name> "Kate".
<http://www.codeproject.com/KB/recipes/n3_notation#Kate> a <http://www.codeproject.com/KB/recipes/n3_notation#girl>.
<http://www.codeproject.com/KB/recipes/n3_notation#Kate> a <http://www.codeproject.com/KB/recipes/n3_notation#person>.
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> <http://www.codeproject.com/KB/recipes/n3_notation#name> "Mark".
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#insomnia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> a <http://www.codeproject.com/KB/recipes/n3_notation#boy>.
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> a <http://www.codeproject.com/KB/recipes/n3_notation#person>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#likes> <http://www.codeproject.com/KB/recipes/n3_notation#Kate>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#name> "Peter".
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#acrophobia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#insomnia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#xenophobia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> a <http://www.codeproject.com/KB/recipes/n3_notation#boy>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> a <http://www.codeproject.com/KB/recipes/n3_notation#person>.
<http://www.dotnetrdf.org/> <http://example.org/createdBy> "Rob Vesse".
这种格式完整地显示所有uri,我如何像第一种格式一样保存它?
请帮我
i programing with c# and dotnetrdflibrery'I have an n3 file that i open it in a notpad and show it below
@prefix my: <http://www.codeproject.com/KB/recipes/n3_notation#>.
my:Peter a my:person, my:boy;
my:suffers my:acrophobia, my:insomnia, my:xenophobia;
my:name "Peter";
my:likes my:Kate.
my:Mark a my:person, my:boy;
my:suffers my:insomnia;
my:name "Mark".
my:Kate a my:person, my:girl;
my:name "Kate".
when i save this file with g.savetofile() it save it like this format that i dont like it i think this have not good view:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix my: <http://www.codeproject.com/KB/recipes/n3_notation#>.
<http://www.codeproject.com/KB/recipes/n3_notation#Kate> <http://www.codeproject.com/KB/recipes/n3_notation#name> "Kate".
<http://www.codeproject.com/KB/recipes/n3_notation#Kate> a <http://www.codeproject.com/KB/recipes/n3_notation#girl>.
<http://www.codeproject.com/KB/recipes/n3_notation#Kate> a <http://www.codeproject.com/KB/recipes/n3_notation#person>.
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> <http://www.codeproject.com/KB/recipes/n3_notation#name> "Mark".
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#insomnia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> a <http://www.codeproject.com/KB/recipes/n3_notation#boy>.
<http://www.codeproject.com/KB/recipes/n3_notation#Mark> a <http://www.codeproject.com/KB/recipes/n3_notation#person>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#likes> <http://www.codeproject.com/KB/recipes/n3_notation#Kate>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#name> "Peter".
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#acrophobia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#insomnia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> <http://www.codeproject.com/KB/recipes/n3_notation#suffers> <http://www.codeproject.com/KB/recipes/n3_notation#xenophobia>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> a <http://www.codeproject.com/KB/recipes/n3_notation#boy>.
<http://www.codeproject.com/KB/recipes/n3_notation#Peter> a <http://www.codeproject.com/KB/recipes/n3_notation#person>.
<http://www.dotnetrdf.org/> <http://example.org/createdBy> "Rob Vesse".
this format show all uri compeletly, how can i save it like the first format?
please help me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)