2009-07-13 27 views
0

我想多值刪除屬性,從RDF,似乎這個RDF從RDF刪除多值的屬性,我應該做下面的代碼去除includeResource:通過Rowlex

<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(..)輸入。對此有任何幫助嗎?

回答

0

rdfDoc.RemoveProperty(subject,predicate,object)實際上需要您指定完整的三元組。此方法由您的stdl.RemoveincludeResource(i)方法包裝。但是,您的包裝方法更易於閱讀並且是類型安全的。宿主C#對象(stdl)是主體,方法(RemoveincludeResource)表示謂詞,輸入參數(i)將是對象。這些項目在內部傳遞給RdfDocument.RemoveProperty方法。 有沒有必要調用這兩種方法!

+0

我非常感謝你的幫助和指導,通過這項工作 – Ehsan 2009-07-13 17:50:23