Hi Rob,
ui:dumpGraph requires a graph URI, so the solutions with one of the
temporary unnamed graphs would not work (as you have found out).
However, using ui:tempGraph does work as confirmed in the attached test
case.
The error handling with ui:tempGraph is not ideal (and I have just added
a better message for the next release), but what the null pointer means
is that it cannot resolve the path in your workspace.
In your case, /tmp/agentmodels_as_sxml.ttl, is there a project called
"tmp" in your TopBraid/Eclipse workspace? It needs to, e.g. if you had a
project "example.org" then use /example.org/file.ttl".
If there is a different null pointer in your case, could you send me the
stack trace?
Thanks,
Holger
On 15/05/2018 10:56, Rob Atkinson wrote:
OK - so I want to try using SPINMap to transform what default import
looks like into the target ontology...
so I'm trying to save the imported graph programmatically, because I'm
still not sure if manual import gives the exact same graph as import
using the sml:ImportXML - and AFAICT SPINMap needs a project file to
load for it its UI based mapping processes
- so, load and save example, set up SPINMap, invoke transformation
using SWP for multiple files in the same XML schema...
tried various things to dump the graph : (NB invoking
with &_contextdebug=true)
If none of these work, noting the graph loads (JSON print out example
provided by Holger works), then what will work and what is wrong with
these options?
<ui:setContext ui:queryGraph=\"{=
ui:graphWithImports(<http://surroundaustralia.com/app/crips/domain/>)
}\">
<sml:ImportXMLFile sml:ignoreDoctype="true"
sm:outputVariable=\"xml\"
sml:sourceFilePath=\"/TQ_models/test0.1/AgentModelsXML/{= ?fileName }\">
<sml:ConvertXMLToRDF
sml:baseURI=\"http://surroundaustralia.com/app/crips/tmp/am_sxml/\"
sml:replace=\"{= true }\" sml:xml=\"{= ?xml }\">
<ui:dumpGraph
ui:graph=\"http://surroundaustralia.com/app/crips/tmp/am_sxml/\" ui:filePath="/tmp/agentmodels_as_sxml.ttl"
/>
</sml:ConvertXMLToRDF>
</sml:ImportXMLFile>
runs with no error - but seems to dump nothing
<ui:setContext ui:queryGraph=\"{=
ui:graphWithImports(<http://surroundaustralia.com/app/crips/domain/>)
}\">
<sml:ImportXMLFile sml:ignoreDoctype="true"
sm:outputVariable=\"xml\"
sml:sourceFilePath=\"/TQ_models/test0.1/AgentModelsXML/{= ?fileName }\">
<sml:ConvertXMLToRDF
sml:baseURI=\"http://surroundaustralia.com/app/crips/tmp/am_sxml/\"
sml:replace=\"{= true }\" sml:xml=\"{= ?xml }\">
</sml:ConvertXMLToRDF>
</sml:ImportXMLFile>
<ui:dumpGraph
ui:graph=\"http://surroundaustralia.com/app/crips/tmp/am_sxml/\" ui:filePath="/tmp/agentmodels_as_sxml.ttl"
/>
runs with no error - but seems to dump nothing
<ui:setContext ui:queryGraph=\"{=
ui:graphWithImports(<http://surroundaustralia.com/app/crips/domain/>)
}\">
<sml:ImportXMLFile sml:ignoreDoctype="true"
sm:outputVariable=\"xml\"
sml:sourceFilePath=\"/TQ_models/test0.1/AgentModelsXML/{= ?fileName }\">
<sml:ConvertXMLToRDF
sml:baseURI=\"http://surroundaustralia.com/app/crips/tmp/am_sxml/\"
sml:replace=\"{= true }\" sml:xml=\"{= ?xml }\">
<ui:dumpGraph ui:graph="{= ui:tempGraph }"
ui:filePath="/tmp/agentmodels_as_sxml.ttl" />
</sml:ConvertXMLToRDF>
</sml:ImportXMLFile>
Gives a null pointer
<ui:setContext ui:queryGraph=\"{=
ui:graphWithImports(<http://surroundaustralia.com/app/crips/domain/>)
}\">
<sml:ImportXMLFile sml:ignoreDoctype="true"
sm:outputVariable=\"xml\"
sml:sourceFilePath=\"/TQ_models/test0.1/AgentModelsXML/{= ?fileName }\">
<sml:ConvertXMLToRDF
sml:baseURI=\"http://surroundaustralia.com/app/crips/tmp/am_sxml/\"
sml:replace=\"{= true }\" sml:xml=\"{= ?xml }\">
<ui:update ui:updateQuery="{! INSERT { GRAPH ui:tempGraph { ?s
?p ?o } } WHERE { ?s ?p ?o } }" />
<ui:dumpGraph ui:graph="{= ui:tempGraph }"
ui:filePath="/tmp/agentmodels_as_sxml.ttl" />
</sml:ConvertXMLToRDF>
</sml:ImportXMLFile>
Gives a null pointer
<ui:setContext ui:queryGraph=\"{=
ui:graphWithImports(<http://surroundaustralia.com/app/crips/domain/>)
}\">
<sml:ImportXMLFile sml:ignoreDoctype="true"
sm:outputVariable=\"xml\"
sml:sourceFilePath=\"/TQ_models/test0.1/AgentModelsXML/{= ?fileName }\">
<sml:ConvertXMLToRDF
sml:baseURI=\"http://surroundaustralia.com/app/crips/tmp/am_sxml/\"
sml:replace=\"{= true }\" sml:xml=\"{= ?xml }\">
</sml:ConvertXMLToRDF>
</sml:ImportXMLFile>
<ui:dumpGraph ui:graph="{= ui:tempGraph }"
ui:filePath="/tmp/agentmodels_as_sxml.ttl" />
Gives a null pointer
--
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "TopBraid
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# baseURI: http://example.org/uiDumpGraph.test
# imports: http://datashapes.org/dash
# imports: http://uispin.org/ui
# prefix: ex
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix default: <http://uispin.org/default#> .
@prefix ex: <http://example.org/uiDumpGraph.test#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix let: <http://uispin.org/let#> .
@prefix letrs: <http://uispin.org/letrs#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix smf: <http://topbraid.org/sparqlmotionfunctions#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spif: <http://spinrdf.org/spif#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix spr: <http://spinrdf.org/spr#> .
@prefix spra: <http://spinrdf.org/spra#> .
@prefix swa: <http://topbraid.org/swa#> .
@prefix tosh: <http://topbraid.org/tosh#> .
@prefix ui: <http://uispin.org/ui#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example.org/uiDumpGraph.test>
rdf:type owl:Ontology ;
rdfs:label "Test of uiDumpGraph" ;
owl:imports <http://datashapes.org/dash> ;
owl:imports <http://uispin.org/ui> ;
owl:versionInfo "Created with TopBraid Composer" ;
.
ex:testDumpTempGraph
rdf:type ui:TestCase ;
ui:prototype """
<ui:group>
<ui:update ui:updateQuery=\"{!
INSERT {
GRAPH ui:tempGraph {
rdf:type a rdf:type .
} .
}
WHERE {
} }\"/>
<ui:dumpGraph ui:filePath=\"/example.org/out.ttl\" ui:graph=\"{=
ui:tempGraph }\"/>
</ui:group>
"""^^ui:Literal ;
rdfs:label "test dump temp graph" ;
rdfs:subClassOf ui:TestCases ;
.