Skip to content

Commit

Permalink
updates SPARQL query support and related tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
mindcrime committed Sep 14, 2014
1 parent 1873ca1 commit e9692c2
Show file tree
Hide file tree
Showing 19 changed files with 824 additions and 9 deletions.
5 changes: 5 additions & 0 deletions grails-app/conf/spring/resources.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,9 @@ beans = {
"java.naming.provider.url":"localhost:1099"]
}

jenaTemplate( org.fogbeam.quoddy.spring.factorybean.JenaTemplateFactoryBean)
{
tdbDirectory = System.getProperty("quoddy.home") + "/jenastore/triples";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.fogbeam.quoddy

import com.hp.hpl.jena.rdf.model.Statement

class SemanticAssertionController
{

// def jenaService;

def index =
{

Map model = [:];


return model;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SparqlController
"PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
"PREFIX dbpo: <http://dbpedia.org/ontology/> PREFIX dbp: <http://dbpedia.org/resource/> PREFIX scorg: <http://schema.org/> ";

String userQueryString = params.sparqlQuery;
String userQueryString = params.queryString;

String queryString = baseQueryString + userQueryString;

Expand Down Expand Up @@ -105,8 +105,7 @@ class SparqlController

println "subject: " + subject;

List<ActivityStreamItem> asiResults = ActivityStreamItem.executeQuery( "select asi from ActivityStreamItem as asi where asi.streamObject.uuid = ?", [subject] );

List<ActivityStreamItem> asiResults = ActivityStreamItem.executeQuery( "select asi from ActivityStreamItem as asi where asi.uuid = ?", [subject] );


if( asiResults != null && !asiResults.isEmpty() )
Expand Down
104 changes: 104 additions & 0 deletions grails-app/controllers/org/fogbeam/quoddy/StatementController.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package org.fogbeam.quoddy

class StatementController
{

def jenaService;

def list =
{

List allStatements = jenaService.listAllStatements();


Map model = [:];

model.put( "allStatements", allStatements);

return model;

}


def addProperty =
{

Map model = [:];

return model;
}

def saveProperty =
{
String propertyUri = params.propertyUri;
String propertyLabel = params.propertyLabel;

jenaService.saveProperty( propertyUri, propertyLabel );

redirect(controller:"statement", action:"list" );
}

def addClass =
{

Map model = [:];

return model;
}

def saveClass =
{
String classUri = params.classUri;
String classLabel = params.classLabel;

jenaService.saveClass( classUri, classLabel );

redirect(controller:"statement", action:"list" );
}


def create =
{
Map model = [:];

return model;
}


def save =
{
String subject = params.subject;
String predicate = params.predicate;
String object = params.object;

jenaService.saveStatementWithResourceObject( subject, predicate, object );

redirect(controller:"statement", action:"list" );

}

def listProperties =
{
List allStatements = jenaService.listProperties();

Map model = [:];

model.put( "allStatements", allStatements );

return model;

}


def listClasses =
{
List allStatements = jenaService.listClasses();

Map model = [:];

model.put( "allStatements", allStatements );

return model;

}
}
Loading

0 comments on commit e9692c2

Please sign in to comment.