Catrina;  I am attaching files that run a sample XML file.  It just imports to RDF and then back to XML ans saves (the idea being that the input and output XML should be the same).

If you debug and Infer Result Triples, you will see that there is a binding for the prefix:
 <samVocab:Node> sxml:prefix samVocab

-- Scott

Catrina wrote:
I notice that the sxml:owl contains the sxml:prefix property.  When I
imported my hierarchy, I imported using XML and ConvertXMLtoRDF.  My
input XML contains xmlns attributes on the root element.  However, I
don't see where sxml:prefix is getting set.  Do I need to set the
sxml:attribute on the sxml:prefix property?  How do I get the
namespace definitions to get stored in the RDF?

On Jul 15, 10:43 am, Scott Henninger <[email protected]>
wrote:
  
ConvertRDFtoXML will add all of the defined prefixes.  Using
smf:prefix and other SPARQL functions, you should be able to ensure
that all prefixes are defined.  Verifying XML is not part of the
Composer tool suite, so I'm not sure namespaces in XML can be
verified.

I'm not sure that even Xpath has access to namespace prefixes in XML
files (http://composing-the-semantic-web.blogspot.com/2009/05/
interacting-with-xml-based-web-services.html).

-- Scott

On Jul 15, 8:58 am, Catrina <[email protected]>
wrote:



    
How does that put the namespace prefix definitions in the XML?
      
For example, my XML needs to contain:
<skos:Concept xmlns:skos="http://www.w3.org/2004/02/skos/core"
      
I want to parse the XML, to ensure that all needed namespace
definitions exist in the XML.
      
~Catrina- Hide quoted text -
      
- Show quoted text -
    


  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

<?xml version="1.0"?>
<samVocab:Node
    xmlns:samVocab="http://topquadrant.com/samVocab";>
   <samVocab:prop>A value</samVocab:prop>
   <samVocab:prop>Another value</samVocab:prop>
   <samVocab:ClassB>
      <samVocab:propA>class B's propertyA value</samVocab:propA>
      <samVocab:propB>class B's propertyB value</samVocab:propB>
   </samVocab:ClassB>
   <samVocab:Node>
      <samVocab:prop>node 2's value 1</samVocab:prop>
      <samVocab:prop>node 2's value 2</samVocab:prop>
   </samVocab:Node>
</samVocab:Node>
# Saved by TopBraid on Thu Jul 16 09:49:57 CDT 2009
# baseURI: http://ThompsonReuters.com/XMLattributes/xmlConvert
# imports: http://topbraid.org/sparqlmotionfunctions
# imports: http://topbraid.org/sparqlmotionlib

@prefix sp:      <http://spinrdf.org/sp#> .
@prefix spin:    <http://spinrdf.org/spin#> .
@prefix samVocab:  <http://topquadrant.com/samVocab#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix sml:     <http://topbraid.org/sparqlmotionlib#> .
@prefix sm:      <http://topbraid.org/sparqlmotion#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sxml:    <http://topbraid.org/sxml#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix :        <http://ThompsonReuters.com/XMLattributes/xmlConvert#> .

<http://ThompsonReuters.com/XMLattributes/xmlConvert>
      a       owl:Ontology ;
      owl:imports <http://topbraid.org/sparqlmotionlib> , 
<http://topbraid.org/sparqlmotionfunctions> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

:ConvertRDFToXML_1
      a       sml:ConvertRDFToXML ;
      rdfs:label "Convert RDFTo XML_1"^^xsd:string ;
      sm:next :ExportToXMLFile_1 ;
      sm:nodeX 307 ;
      sm:nodeY 155 ;
      sm:outputVariable "xml" .

:ExportToXMLFile_1
      a       sml:ExportToXMLFile ;
      rdfs:label "Export to XMLFile_1"^^xsd:string ;
      sml:targetFilePath "newVocab.xml"^^xsd:string .

:ImportRDFFromWorkspace_1
      a       sml:ImportRDFFromWorkspace ;
      rdfs:label "Import RDFFrom workspace_1"^^xsd:string ;
      sm:next :ConvertRDFToXML_1 ;
      sml:sourceFilePath "vocab.xml"^^xsd:string .

Reply via email to