Author: lgiessmann Date: Mon Sep 7 10:43:54 2009 New Revision: 135
Log: rdf-importer: added an RDF test file with exported and mapped TM constructs.
Added: trunk/src/unit_tests/full_mapping.rdf Modified: trunk/src/isidorus.asd trunk/src/xml/rdf/map_to_tm.lisp
Modified: trunk/src/isidorus.asd ============================================================================== --- trunk/src/isidorus.asd (original) +++ trunk/src/isidorus.asd Mon Sep 7 10:43:54 2009 @@ -110,6 +110,7 @@ (:static-file "poems.rdf") (:static-file "poems_light.rdf") (:static-file "poems_light.xtm") + (:static-file "full_mapping.rdf") (:file "atom-conf") (:file "unittests-constants" :depends-on ("dangling_topicref.xtm"
Added: trunk/src/unit_tests/full_mapping.rdf ============================================================================== --- (empty file) +++ trunk/src/unit_tests/full_mapping.rdf Mon Sep 7 10:43:54 2009 @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="UTF-8"?> +<rdf:RDF xmlns:isi="http://isidorus/tm2rdf_mapping/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:xml="http://www.w3.org/XML/1998/namespace%22%3E + <!-- === topic: marge ==================================================== --> + <rdf:Description rdf:about="http://simpsons/marge%22%3E + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Topic%22/%3E + isi:name + <rdf:Description rdf:nodeID="id_283"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Name%22/%3E + <isi:nametype rdf:resource="http://simpsons/firstName%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EMarjorie</isi:value> + </rdf:Description> + </isi:name> + isi:name + <rdf:Description rdf:nodeID="id_285"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Name%22/%3E + <isi:nametype rdf:resource="http://simpsons/lastName%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3ESimpson</isi:value> + </rdf:Description> + </isi:name> + <ns5:profession xmlns:ns5="http://simpsons/" rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EHousewife</ns5:profession> + <isi:occurrence rdf:nodeID="id_1234"/> <!-- equal to ns5:profession, should be merged --> + </rdf:Description> + + <rdf:Description rdf:nodeID="id_1234"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Occurrence%22/%3E + <isi:occurrencetype rdf:resource="http://simpsons/profession%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EHousewife</isi:value> + </rdf:Description> + + + <rdf:Description rdf:nodeID="id_285"> + <isi:variant rdf:parseType="Resource"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Variant%22/%3E + <isi:scope rdf:resource="http://simpsons/display%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EMarge</isi:value> + </isi:variant> + </rdf:Description> + + + <rdf:Description rdf:about="http://simpsons/marge%22%3E + <isi:subjectIdentifier rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI%22%3Ehttp://simpsons/marjorie</isi:subjectIdentifier> + </rdf:Description> + + <!-- === topic: homer ==================================================== --> + <rdf:Description rdf:about="http://simpsons/homer%22%3E + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Topic%22/%3E + <isi:subjectIdentifier rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI%22%3Ehttp://simpsons/homer_simpson</isi:subjectIdentifier> + <isi:subjectLocator rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI%22%3Ehttp://some.where/resource</isi:subjectLocator> + <isi:itemIdentity rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI%22%3Ehttp://simpsons/ii/homer</isi:itemIdentity> + isi:name + <rdf:Description rdf:nodeID="id_266"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Name%22/%3E + <isi:nametype rdf:resource="http://simpsons/firstName%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EHomer J.</isi:value> + isi:variant + <rdf:Description rdf:nodeID="id_272"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Variant%22/%3E + <isi:scope rdf:resource="http://simpsons/display%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EHomer</isi:value> + </rdf:Description> + </isi:variant> + </rdf:Description> + </isi:name> + <!-- <isi:name rdf:resource="id_2345"/> --> <!-- should be merged with id_266 --> + isi:name + <rdf:Description rdf:nodeID="id_277"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Name%22/%3E + <isi:nametype rdf:resource="http://simpsons/lastName%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3ESimpson</isi:value> + </rdf:Description> + </isi:name> + isi:occurrence + <rdf:Description rdf:nodeID="id_279"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Occurrence%22/%3E + <isi:occurrencetype rdf:resource="http://simpsons/profession%22/%3E + <isi:scope rdf:resource="http://simpsons/en%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3ESafety Inspector</isi:value> + </rdf:Description> + </isi:occurrence> + </rdf:Description> + + <rdf:Description rdf:about="id_2345"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Name%22/%3E + <isi:nametype rdf:resource="http://simpsons/firstName%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EHomer J.</isi:value> + isi:variant + <rdf:Description rdf:nodeID="id_272"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Variant%22/%3E + <isi:scope rdf:resource="http://simpsons/display%22/%3E + <isi:value rdf:datatype="http://www.w3.org/2001/XMLSchema#string%22%3EHomer</isi:value> + </rdf:Description> + </isi:variant> + </rdf:Description> + + <!-- === association: married ============================================ --> + <rdf:Description rdf:nodeID="id_291"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Association%22/%3E + <isi:associationtype rdf:resource="http://simpsons/married%22/%3E + <isi:itemIdentity rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI%22%3Ehttp://simpsons/married/ii-1</isi:itemIdentity> + isi:role + <rdf:Description rdf:nodeID="id_292"> + <isi:itemIdentity rdf:datatype="">http://simpsons/role-husband/ii</isi:itemIdentity> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Role%22/%3E + <isi:roletype rdf:resource="http://simpsons/husband%22/%3E + <isi:player rdf:resource="http://simpsons/homer%22/%3E + </rdf:Description> + </isi:role> + isi:role + <rdf:Description rdf:nodeID="id_295"> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Role%22/%3E + <isi:roletype rdf:resource="http://simpsons/wife%22/%3E + <isi:player rdf:resource="http://simpsons/marge%22/%3E + </rdf:Description> + </isi:role> + </rdf:Description> + + rdf:Description + <isi:itemIdentity rdf:datatype="">http://simpsons/maried/ii-2</isi:itemIdentity> + isi:role + <rdf:Description rdf:nodeID="id_295"> + <isi:itemIdentity rdf:datatype="">http://simpsons/role-wife/ii</isi:itemIdentity> + <rdf:type rdf:resource="http://isidorus/tm2rdf_mapping/types/Role%22/%3E + <isi:roletype rdf:resource="http://simpsons/wife%22/%3E + <isi:player rdf:resource="http://simpsons/marge%22/%3E + </rdf:Description> + </isi:role> + </rdf:Description> +</rdf:RDF> \ No newline at end of file
Modified: trunk/src/xml/rdf/map_to_tm.lisp ============================================================================== --- trunk/src/xml/rdf/map_to_tm.lisp (original) +++ trunk/src/xml/rdf/map_to_tm.lisp Mon Sep 7 10:43:54 2009 @@ -302,8 +302,8 @@ (map 'list #'d::delete-construct type-assocs) (map 'list #'d::delete-construct scope-assocs) (when (/= 1 (length types)) - (error "~aexpect one type topic but found: ~a" - err-pref (length types))) + (error "~aexpect one type topic but found: ~a (~a)" + err-pref (length types) value)) (let ((name (make-construct 'NameC :start-revision start-revision :topic top