- From: Henry Story <henry.story@bblfish.net>
- Date: Fri, 14 Jan 2005 15:10:21 +0100
- To: jsled@asynchronous.org
- Cc: www-rdf-interest@w3.org, Phil Dawes <pdawes@users.sourceforge.net>
On 13 Jan 2005, at 16:25, Josh Sled wrote: > On Thu, 2005-01-13 at 03:52, Phil Dawes wrote: > >> I've written a script (to test the idea) that does pretty-much the >> same translation - if you're interested I'll stick it on the web >> somewhere when I get to work. > > Nice. It looks like you go strictly to blank nodes, and have the > "element = property" and "non-leaf-elements are blank-nodes" heuristic. So that differs from my mapping [1] in that for me elements and attributes are always mapped to a relationship between blank nodes. This then allows a combination of information from an ontology and well defined graph inferencing to get me to the final state. >> N.B. I think it'd also need to handle ordered collections to be >> generically useful (since xml is implicitly ordered). > > Yeah, it seems like the pain is to deal with: I agree. This is a good problem to raise. > > <foo> > <barProp>bar</barProp> > <bazProp>baz</bazProp> > <items>item1</items> > <items>item2</items> > </foo> my initial take on this is that we can do two things in the mapping: - we can map as I have explained [1] - and we can add order information to the graph. So I map the above to [ :foo [ :barProp [ xxx:string "bar" ]; :bazProp [ xxx:string "baz" ]; :items [ xxx:string "item1" ]; :items [ xxx:string "item2" ] ] ] . which with an ontology that specifies that :barProp, :bazProp and :items are relationships that map to things of type String simplify to [ :foo [ :barProp "bar"; :bazProp "baz"; :items "item1"; :items "item2" ] ] . or if we make the anonymous nodes explicit _x :foo _f . _f :barProp "bar". _f :bazProp "baz". _f :items "item1". _f :items "item2". Of course the original parse allowed us to add the following statements (simplified a little) { _x :foo _f } :before { _f :barProp "bar" } { _f :barProp "bar" } :before { _f :bazProp "baz" } { _f :bazProp "baz" } :before { _f :items "item1" } { _f :items "item1" } :before { _f :items "item2" } > > Since you don't want to have to tell people they need to insert another > level... > > What about... > > <foo is:aListOf="items"> > <!-- ... --> > </> > ? And in the procedure I am describing there is no need for the rdf:aListOf to appear directly in the xml. It sufficed that it be found in the ontology in a statement saying that foo is a relation onto an object that is an ordered list. (This is nice because it clears up the xml a lot) Now there should be a way, given some semantic information that :foo is a list to use the sentence order information to create an ordered list object. I don't understand rdf lists enough, but I don't see that it should be impossible. > Which, given the content above, becomes: > > [ :foo [ :barProp "bar"; :bazProp "baz" > ; :items ( "item1" "item2" ) ] ]. > > With namespace/qname handling as per: > > <eg:foo is:aListOf="⪚items"> > <!-- ... --> > </> > > While I'm writing this out... another pain is striping and typing. > I've > been thinking about something like... > > <eg:foo is:a="⪚Foo" /> > > ...with an alternative being... > > <eg:foo is:a="⪚Foo"> > <is:a>&eg2;Bar</is:a> > </> For me that is easy. I find that information in the ontology. But if people want to be explicit they can always use rdf:type="sometype" or <rdf:type>http://example.com/sometype</rdf:type> <rdf:type>http://example.com/someOtherType/rdf:type> > ... with the motivation that anything needing to represent _two_ > rdf:types can deal with the weirdness the above presents. > > Also, I guess you adopt `is:about="..."` for subjects, and `is:at` for > resource-objects. > > Oh yeah, and there's no option to put anything in attributes. It's all > in elements, except as per above. I think my system works well with attributes? No? > Thoughts? > > ...jsled > > -- > http://asynchronous.org/ - `a=jsled; b=asynchronous.org; echo > ${a}@${b}` > [1] See the email archived on the bloged mailing list that did the best job at keeping the ascii diagrams intact: <https://bloged.dev.java.net/servlets/ReadMsg?list=users&msgNo=441> I also wrote a condensed, and perhaps even clearer version here: <http://lists.w3.org/Archives/Public/www-rdf-interest/2005Jan/ 0090.html>
Received on Friday, 14 January 2005 14:10:28 UTC