Results 1 to 1 of 1

Thread: Reading a UDF

  1. #1
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Malta (EU)
    Rep Power

    Default Reading a UDF

    I am trying to read an RDF, and, following a tutorial I pasted the following code, however I am puzzled at how to query the "URI:" tags, I feel I am on the wrong track.

    I have reviewed some video tutorials on YouTube, not sure if they are complete.

    Java Code:
    import org.jsoup.Jsoup;
    import org.jsoup.nodes.Document;
    import org.apache.commons.*;
    import org.apache.jena.util.FileManager;
    import org.apache.jena.rdf.model.ModelFactoryBase; 
    import java.lang.Object;
    public class parseRDF {
    	public static void main (String... args)
    		Document result = Jsoup.parse("");
    	static void sparqlTest()
    		String path = "C:\\Users\Administrator\\Downloads\\ics_5111_dataset\\ics_5111_dataset\\user_2\\User Activity";
    		Model model = FileManager.get().loadModel(path);
    		String queryString = 
    				"PREFIX rdf: <"> 
    						+ "PREFIX foaf: <http:///>"
    						+ "SELECT * WHERE { " + 
    						" ?uri?." +
    				Query query = QueryFactory.create(queryString);
    				QueryExecution qexec = QueryExecutionFactory.create(query,model);
    				try {
    					ResultSet results = qexec.execSelect();
    					while (results.hasNext())
    						QuerySolution soln = results.nextSolution();
    						Literal name = soln.Literal("x");
    						Model m = Model;
    				catch (Exception e) { System.out.println(e.Message())};
    				finally {
    I am using Apache Jena, and, I was suggested to use JSoup, although there are other technologies to read RDFs that I might experiment with such as Python RDFLibraries

    It is noted that unfortunately it not possible to highlight
    Java Code:
    tags in bold when one attempts to use bold.
    Last edited by jon80; 12-17-2015 at 10:41 AM.

Similar Threads

  1. Reading XML
    By JSN1 in forum XML
    Replies: 6
    Last Post: 05-16-2012, 07:43 PM
  2. Reading log
    By Darth Blue Ray in forum New To Java
    Replies: 1
    Last Post: 03-15-2011, 10:35 PM
  3. reading from a .txt
    By Flamespewer in forum New To Java
    Replies: 1
    Last Post: 09-14-2009, 09:35 AM
  4. Replies: 5
    Last Post: 08-21-2009, 12:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts