Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Done
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I am using Blazegraph for a while. However, I cannot use the UI to export my RDF. There is an export button at the bottom of the workbench. When I execute my query and I click on it in order to export my file as RDF/XML format it gives me an error message. It doesn't show me any error when I export as CSV, JSON or XML. I have also tested it with different servers and localhost but I get the same server error pop up message.

        Activity

        Hide
        beebs Brad Bebee added a comment -

        igorkim Could you take a look at this one?

        Show
        beebs Brad Bebee added a comment - igorkim Could you take a look at this one?
        Hide
        beebs Brad Bebee added a comment - - edited

        There is a work around using the REST API directly: https://wiki.blazegraph.com/wiki/index.php/REST_API#Exporting_a_Namespace

        
        curl -X POST http://localhost:9999/blazegraph/sparql --data-urlencode \
        'query=CONSTRUCT  WHERE { hint:Query hint:analytic "true" . hint:Query hint:constructDistinctSPO "false" . ?s ?p ?o }' \ 
        -H 'Accept:application/rdf+xml' | gzip > <filename>
        
        Show
        beebs Brad Bebee added a comment - - edited There is a work around using the REST API directly: https://wiki.blazegraph.com/wiki/index.php/REST_API#Exporting_a_Namespace curl -X POST http: //localhost:9999/blazegraph/sparql --data-urlencode \ 'query=CONSTRUCT WHERE { hint:Query hint:analytic " true " . hint:Query hint:constructDistinctSPO " false " . ?s ?p ?o }' \ -H 'Accept:application/rdf+xml' | gzip > <filename>
        Hide
        igorkim igorkim added a comment -

        This issue seems to be related https://github.com/blazegraph/database/issues/37
        thompsonbry: The root cause is likely to be a change in the order in which the JARs are being loaded causing initialization to not find the RIO parser for application/rdf+xml.

        I will look into how the load order could be ensured in packed jar.

        Show
        igorkim igorkim added a comment - This issue seems to be related https://github.com/blazegraph/database/issues/37 thompsonbry: The root cause is likely to be a change in the order in which the JARs are being loaded causing initialization to not find the RIO parser for application/rdf+xml. I will look into how the load order could be ensured in packed jar.
        Hide
        igorkim igorkim added a comment -

        Actually, JAR file already uses maven-shade plugin, which properly merges all parsers and writers configurations.

        The issue here is that workbench implications differs from server-side.
        Workbench consider query result to be RDF data if there are 3 components named 's', 'p', 'o':

         if(data.head.vars.length == 3 && data.head.vars[0] == 's' && data.head.vars[1] == 'p' && data.head.vars[2] == 'o') {
                 isRDF = true;
        ...
        

        That also results in RDF formats disabled if CONSTRUCT query is executed (as there is not 's','p','o' bindings, they are called 'subject', 'predicate', 'object' for CONSTRUCT response).

        So RDF/XML type could be used only if SELECT ?s ?p ?o query is executed.
        But server expects bindings 'subject', 'predicate' and 'object' in com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONParserForConstruct.handleSolution(BindingSet)

         if (!bs.hasBinding("subject")) {
                    throw new TupleQueryResultHandlerException("no subject: " + bs);
                }
                if (!bs.hasBinding("predicate")) {
                    throw new TupleQueryResultHandlerException("no predicate: " + bs);
                }
                if (!bs.hasBinding("object")) {
                    throw new TupleQueryResultHandlerException("no object: " + bs);
                }
        

        Thus an exception 'no subject' is thrown and reported at workbench.

        Show
        igorkim igorkim added a comment - Actually, JAR file already uses maven-shade plugin, which properly merges all parsers and writers configurations. The issue here is that workbench implications differs from server-side. Workbench consider query result to be RDF data if there are 3 components named 's', 'p', 'o': if (data.head.vars.length == 3 && data.head.vars[0] == 's' && data.head.vars[1] == 'p' && data.head.vars[2] == 'o') { isRDF = true ; ... That also results in RDF formats disabled if CONSTRUCT query is executed (as there is not 's','p','o' bindings, they are called 'subject', 'predicate', 'object' for CONSTRUCT response). So RDF/XML type could be used only if SELECT ?s ?p ?o query is executed. But server expects bindings 'subject', 'predicate' and 'object' in com.bigdata.rdf.rio.json.BigdataSPARQLResultsJSONParserForConstruct.handleSolution(BindingSet) if (!bs.hasBinding( "subject" )) { throw new TupleQueryResultHandlerException( "no subject: " + bs); } if (!bs.hasBinding( "predicate" )) { throw new TupleQueryResultHandlerException( "no predicate: " + bs); } if (!bs.hasBinding( "object" )) { throw new TupleQueryResultHandlerException( "no object: " + bs); } Thus an exception 'no subject' is thrown and reported at workbench.
        Hide
        beebs Brad Bebee added a comment -

        Thanks. Can you suggest a patch for this one?

        Show
        beebs Brad Bebee added a comment - Thanks. Can you suggest a patch for this one?
        Hide
        na4845 Neda Abolhassani added a comment -

        Hi,

        Would you please let me know where I should specify the namespace when I use the REST API command?
        curl -X POST http://localhost:9999/blazegraph/sparql --data-urlencode \
        'query=CONSTRUCT WHERE

        { hint:Query hint:analytic "true" . hint:Query hint:constructDistinctSPO "false" . ?s ?p ?o }

        ' \
        -H 'Accept:application/rdf+xml' | gzip > <filename>

        I also wonder if I can save the <filename> as an RDF file? i.e. ... gzip > output.rdf

        Thanks.

        Show
        na4845 Neda Abolhassani added a comment - Hi, Would you please let me know where I should specify the namespace when I use the REST API command? curl -X POST http://localhost:9999/blazegraph/sparql --data-urlencode \ 'query=CONSTRUCT WHERE { hint:Query hint:analytic "true" . hint:Query hint:constructDistinctSPO "false" . ?s ?p ?o } ' \ -H 'Accept:application/rdf+xml' | gzip > <filename> I also wonder if I can save the <filename> as an RDF file? i.e. ... gzip > output.rdf Thanks.
        Hide
        igorkim igorkim added a comment -

        Neda Abolhassani, to store not gzipped RDF file you just need to omit "| gzip" command. A namespace (for ex. ns1234) could be specified in the URL of the endpoint:

        curl -X POST http://localhost:9999/blazegraph/namespace/ns1234/sparql --data-urlencode \
        'query=CONSTRUCT WHERE { hint:Query hint:analytic "true" . hint:Query hint:constructDistinctSPO "false" . ?s ?p ?o }' \ 
        -H 'Accept:application/rdf+xml' > output.rdf
        
        Show
        igorkim igorkim added a comment - Neda Abolhassani , to store not gzipped RDF file you just need to omit "| gzip" command. A namespace (for ex. ns1234) could be specified in the URL of the endpoint: curl -X POST http: //localhost:9999/blazegraph/namespace/ns1234/sparql --data-urlencode \ 'query=CONSTRUCT WHERE { hint:Query hint:analytic " true " . hint:Query hint:constructDistinctSPO " false " . ?s ?p ?o }' \ -H 'Accept:application/rdf+xml' > output.rdf
        Hide
        igorkim igorkim added a comment -
        Show
        igorkim igorkim added a comment - Brad Bebee , here is PR: https://github.com/blazegraph/database/pull/42

          People

          • Assignee:
            beebs Brad Bebee
            Reporter:
            na4845 Neda Abolhassani
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: