我正在尝试从RDF中删除具有多个值的属性,似乎是关于这个RDF,我应该编写以下代码来删除includeResource:
<Ontologyowl:StudyList rdf:about="stdl827181">
<Ontologyowl:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Basic learning materials</Ontologyowl:title>
<Ontologyowl:includeResource>
<Ontologyowl:LearningResource rdf:about="res298830"/>
</Ontologyowl:includeResource>
<Ontologyowl:includeResource>
<Ontologyowl:LearningResource rdf:about="res323717"/>
</Ontologyowl:includeResource>
</Ontologyowl:StudyList>
StudyList_ stdl = (StudyList_)rdfDoc.GetIndividual(stdlId, StudyList.Uri, false);
LearningResource[] lrnRes = stdl.includeResources;
foreach (LearningResource i in lrnRes)
{
stdl.RemoveincludeResource(i);
rdfDoc.RemoveProperty(...);
}但我现在不了解rdfDoc.RemoveProperty(..)输入。有什么需要帮忙的吗?
发布于 2009-07-13 07:51:32
RdfDoc.RemoveProperty(主语、谓语、宾语)实际上需要您指定完整的三元组。此方法由您的stdl.RemoveincludeResource(i)方法包装。但是,您的包装方法更易于阅读,而且是类型安全的。宿主C#宾语(RemoveincludeResource)是主语,方法(stdl)表示谓语,输入参数(i)将是宾语。这些项在内部传递给RdfDocument.RemoveProperty方法。不需要同时调用两个方法!
https://stackoverflow.com/questions/1117848
复制相似问题