I'm looking for a library in C# for my task. As input, I'm supposed to have an RDFS/XML file (snippet provided under text) which contains thousands of entities, each with their own properties and attributes. For each entity, I'm supposed to extract all of it's properties and attributes, and map them accordingly to some "Entity" model I'll have.

 <rdf:Description rdf:about="#ProtectedSwitch">
<rdfs:label xml:lang="en">ProtectedSwitch</rdfs:label>
<rdfs:subClassOf rdf:resource="#Switch"/>
<rdfs:comment  rdf:parseType="Literal">A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment.</rdfs:comment>
<cims:belongsToCategory rdf:resource="#Package_Wires"/>
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
 <rdf:Description rdf:about="#RatioTapChanger">
<rdfs:label xml:lang="en">RatioTapChanger</rdfs:label>
<rdfs:subClassOf rdf:resource="#TapChanger"/>
<rdfs:comment  rdf:parseType="Literal">A tap changer that changes the voltage ratio impacting the voltage magnitude but not the phase angle across the transformer.</rdfs:comment>
<cims:belongsToCategory rdf:resource="#Package_Wires"/>
<cims:stereotype rdf:resource="http://iec.ch/TC57/NonStandard/UML#concrete"/>
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>

In the above snippet, there are 2 entities (ProtectedSwitch and RatioTapChanger). From the ProtectedSwitch I should extract the following info: name(#ProtectedSwitch), properties with their values (label, subClassOf, comment...). Also, some properties don't have text between opening and closing tags, they only contain an attribute reference (rdfs:subClassOf rdf:resource="#Switch"). In that case, I would like to extract the prefix (rdf) and the value of the attribute.

Every other entity in the RDFS file will be in the same format.

Also I would be grateful if someone could provide an example for the parsing of ProtectedSwitch and extracting the info I mentioned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.