[Mulgara-general] load RDF/XML post

Paul Gearon gearon at ieee.org
Wed Oct 28 15:19:41 UTC 2009


Hi,

Out of curiosity, what did the code print to the output? You should
have received an error code at the very least, though I'm disappointed
you didn't see a message. I'll check that out.

The error in your file is a space in a URI. Check out line 289:
<desc:Resource_Description
rdf:about="http://www.owl-ontologies.com/Ontology1254775929.owl#Gladstone_Flow_Cytometry_Core
">

Notice the space character at the end of the URI?

Meanwhile, I'll work to provide a descriptive response.

Regards,
Paul

On Tue, Oct 27, 2009 at 10:51 AM, Chuck Borromeo <cborromeo3 at yahoo.com> wrote:
> [Using Mulgara 2.1.4 binary dist]
>
> Hello,
>  I have developed some Java code to load an RDF file using Http POST.  I have been able to load over 30 RDF files using this method.  However, one of the files I attempt to load does not insert its data into the graph.  The URL for the problematic file is:
>
> http://hsresweb01.ucdmc.ucdavis.edu/RDF/UCSanFrancisco.rdf
> My code does not throw any error message.  I cannot find any errors in any of the mulgara logs files or the itql file.  I have opened the RDF file in the W3C RDF validator and the file appears valid.  Here are some files that load successfully:
>
> http://hsresweb01.ucdmc.ucdavis.edu/RDF/UWisconsinMadison.rdf
> http://hsresweb01.ucdmc.ucdavis.edu/RDF/Duke.rdf
> Here is my code (adapted from Paul Gearon) :
>    public String loadRDF(URL rdfURL, String graphname) {
>        HttpClient client = new DefaultHttpClient();
>
>        HttpPost post = new HttpPost(generateServerName());
>
>        client.getParams().setBooleanParameter(
>                CoreProtocolPNames.USE_EXPECT_CONTINUE, false);
>
>        try {
>            createGraph(graphname);
>            String data = "";
>            InputStream is = rdfURL.openStream();
>            data = convertStreamToString(is);
>            MultipartEntity e = new MultipartEntity();
>            e.addPart("default-graph-uri", new StringBody(graphname));
>            e.addPart("data", new Body(data, rdfURL.toString(), Charset
>                    .forName("UTF-8")));
>            post.setEntity(e);
>
>            HttpResponse response = client.execute((HttpUriRequest) post);
>            StatusLine status = response.getStatusLine();
>            System.out.println("code: " + status.getStatusCode() + ": "
>                    + status.getReasonPhrase());
>            HttpEntity entity = response.getEntity();
>
>            if (entity != null) {
>                InputStream instream = entity.getContent();
>                BufferedReader reader = new BufferedReader(
>                        new InputStreamReader(instream));
>                System.out.println("Got response:");
>                String line;
>                while ((line = reader.readLine()) != null)
>                    System.out.println(line);
>            } else {
>                System.out.println("No entity in response");
>            }
>            System.out.println("Done loading file");
>        } catch (UnsupportedEncodingException e) {
>            System.err.println("Unable to encode data: " + e.getMessage());
>        } catch (ClientProtocolException cpe) {
>            System.err.println("Error in protocol: " + cpe.getMessage());
>        } catch (IOException ioe) {
>            System.err.println("Error executing POST: " + ioe.getMessage());
>        } catch (Exception ge) {
>            System.err.println("Error executing load rdf: " + ge.getMessage());
>
>        }
>
>        return "";
>    }
>
>
> Is there some logging to turn on to capture more information from mulgara?
> Thanks,
> Chuck
>
>
>
>
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
>



More information about the Mulgara-general mailing list