getting the value in rdf:datatype

View: New views
2 Messages — Rating Filter:   Alert me  

getting the value in rdf:datatype

by The Boy :: Rate this Message:

| View Threaded | Show Only this Message

Hello all,

I am trying to parse an owl file(rdf/xml file) using the XML parser in C# .Net.
I have two questions:

1. how can I test that a XML node contains rdf:datatype attribute

2. how can I get "aValue" when rdf:datatype = "aValue"

here are some lines I would like to parse:

<Employee rdf:ID="EmployeeTest">

    <hasName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
           EmployeeTestName
    </hasName>

 </Employee>

I would like to retrieve "http://www.w3.org/2001/XMLSchema#string".

Thanks in advance for your help.

Joe.

Parent Message unknown Re: getting the value in rdf:datatype

by Toby Inkster-4 :: Rate this Message:

| View Threaded | Show Only this Message


The Boy wrote:

> I am trying to parse an owl file(rdf/xml file) using the XML parser in C#
> ..Net.

Firstly, this is probably not the best mailing list to ask. This is the
RDFa taskforce mailing list - not RDF/XML. semantic-web@... might be
a better bet.

Secondly, do yourself a favour and stop trying to use an XML parser to
parse RDF - it won't be up to the job. Sure, it's *possible* to parse
RDF using an XML parser, but only in the same sense that it's *possible*
to toast bread using a cigarette lighter.

Here's an RDF parser for .NET. I don't know if it's any good:

        http://www.schemaweb.info/parser/Parser.aspx

I'm sure there are many others.

> how can I test that a XML node contains rdf:datatype attribute

If you persist in trying to use an XML parser, then assuming you have a
DOM built, use the standard DOM functions: things like getAttributeNS.

--
Toby Inkster <tai@...>