diff --git a/java/registry-middleware/.gitignore b/java/registry-middleware/.gitignore deleted file mode 100644 index b83d22266..000000000 --- a/java/registry-middleware/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/ruby/Gemfile b/ruby/Gemfile deleted file mode 100644 index c6fd86538..000000000 --- a/ruby/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' - -gem 'json-ld' -gem 'rdf-reasoner' -gem 'rdf-turtle' \ No newline at end of file diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock deleted file mode 100644 index 6ee94606c..000000000 --- a/ruby/Gemfile.lock +++ /dev/null @@ -1,41 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - concurrent-ruby (1.0.5) - ebnf (1.1.1) - rdf (~> 2.2) - sxp (~> 1.0) - hamster (3.0.0) - concurrent-ruby (~> 1.0) - json-ld (2.1.7) - multi_json (~> 1.12) - rdf (~> 2.2, >= 2.2.8) - link_header (0.0.8) - multi_json (1.12.2) - rdf (2.2.12) - hamster (~> 3.0) - link_header (~> 0.0, >= 0.0.8) - rdf-reasoner (0.4.3) - rdf (~> 2.2, >= 2.2.8) - rdf-vocab (~> 2.2) - rdf-xsd (~> 2.1) - rdf-turtle (2.2.1) - ebnf (~> 1.1) - rdf (~> 2.2) - rdf-vocab (2.2.8) - rdf (~> 2.2) - rdf-xsd (2.2.0) - rdf (~> 2.1) - sxp (1.0.0) - rdf (~> 2.0) - -PLATFORMS - ruby - -DEPENDENCIES - json-ld - rdf-reasoner - rdf-turtle - -BUNDLED WITH - 1.16.0 diff --git a/ruby/teacher.json b/ruby/teacher.json deleted file mode 100644 index ad55f0c65..000000000 --- a/ruby/teacher.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "@context": - { - "Teacher": "http://xmlns.com/foaf/0.1/Person", - "xsd": "http://www.w3.org/2001/XMLSchema#", - "identifier": "http://schema.org/identifier", - "name": "http://xmlns.com/foaf/0.1/name", - "affiliation": "http://schema.org/affiliation", - "knowsLanguage": "http://schema.org/language", - "avatar": - { - "@id": "http://xmlns.com/foaf/0.1/depiction", - "@type": "@id" - }, - "image": - { - "@id": "http://xmlns.com/foaf/0.1/img", - "@type": "@id" - }, - "born": - { - "@id": "http://schema.org/birthDate", - "@type": "xsd:dateTime" - }, - "died": - { - "@id": "http://schema.org/deathDate", - "@type": "xsd:dateTime" - }, - "email": - { - "@id": "http://xmlns.com/foaf/0.1/mbox", - "@type": "@id" - }, - "gender": "http://schema.org/gender" - }, - "id": "1234", - "name": "Shashank Teotia", - "knowsLanguage":["hi","en"], - "avatar":"https://avatars2.githubusercontent.com/u/230125?s=400&v=4", - "born":"010101" - } - \ No newline at end of file diff --git a/ruby/tryout.rb b/ruby/tryout.rb deleted file mode 100644 index 6ce6a0d6d..000000000 --- a/ruby/tryout.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'json' -require 'pp' -require 'json/ld' -require 'rdf/turtle' -require 'rdf/reasoner' - -file = File.read "teacher.json" -input = JSON.parse(file) -graph = RDF::Graph.new << JSON::LD::API.toRdf(input) -pp graph.dump(:ttl, prefixes: {foaf: "http://xmlns.com/foaf/0.1/"}) - -RDF::Reasoner.apply(:rdfs) - -obj = RDF::Literal(Date.new) -p RDF::Vocab::DOAP.created.range_compatible?(obj, graph) \ No newline at end of file diff --git a/spikes/java/jena/pom.xml b/spikes/java/jena/pom.xml deleted file mode 100644 index 91e531bad..000000000 --- a/spikes/java/jena/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - 4.0.0 - - org.opensaber - open-saber-poc - 0.0.1-SNAPSHOT - jar - - open-saber-poc - http://maven.apache.org - - - UTF-8 - - - - - org.apache.jena - jena-arq - 3.5.0 - - - org.apache.jena - jena-core - 3.5.0 - - - org.apache.jena - jena-tdb - 3.5.0 - - - junit - junit - 3.8.1 - test - - - com.github.jsonld-java - jsonld-java - 0.11.1 - - - diff --git a/spikes/java/jena/src/main/java/org/opensaber/java/poc/JavaJsonLdToRdfConverter.java b/spikes/java/jena/src/main/java/org/opensaber/java/poc/JavaJsonLdToRdfConverter.java deleted file mode 100644 index e008f380b..000000000 --- a/spikes/java/jena/src/main/java/org/opensaber/java/poc/JavaJsonLdToRdfConverter.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.opensaber.java.poc; - -import java.io.FileInputStream; -import java.io.InputStream; - -import com.fasterxml.jackson.core.JsonGenerationException; -import com.github.jsonldjava.core.JsonLdProcessor; -import com.github.jsonldjava.utils.JsonUtils; - -/** - * - * @author jyotsna - * This class uses com.github.jsonld-java to convert json-ld to RDF - * - */ -public class JavaJsonLdToRdfConverter { - - public static void main(String args[]){ - try{ - InputStream inputStream = new FileInputStream("testing/teacher.json"); - Object compact = JsonLdProcessor.toRDF(JsonUtils.fromInputStream(inputStream)); - System.out.println(JsonUtils.toPrettyString(compact)); - }catch(JsonGenerationException e){ - e.printStackTrace(); - } - catch(Exception e){ - e.printStackTrace(); - } - - } - -} diff --git a/spikes/java/jena/src/main/java/org/opensaber/jena/poc/JsonLdToRdfConverter.java b/spikes/java/jena/src/main/java/org/opensaber/jena/poc/JsonLdToRdfConverter.java deleted file mode 100644 index 807947b24..000000000 --- a/spikes/java/jena/src/main/java/org/opensaber/jena/poc/JsonLdToRdfConverter.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.opensaber.jena.poc; - -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.StringReader; - -import org.apache.jena.query.Dataset; -import org.apache.jena.query.Query; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.QueryFactory; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ReadWrite; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.tdb.TDBFactory; -import org.apache.jena.tdb.base.file.Location; - -/** - * - * @author jyotsna - * This class uses apache jena to convert json-ld to RDF - * - */ -public class JsonLdToRdfConverter { - - private static final String OPEN_SABER_GRAPH = "http://open-saber.org/graph1/"; - private static final String TDB_DIRECTORY = "//home//tdb"; - - public static void main(String args[]){ - JsonLdToRdfConverter jsonLdToRdfConverter = new JsonLdToRdfConverter(); - jsonLdToRdfConverter.writeAndReadJsonLd(); - } - - public void writeAndReadJsonLd() { - try { - InputStream inputStream = new FileInputStream("testing/teacher.json"); - Model m = ModelFactory.createDefaultModel(); - m.read(inputStream, null, "JSON-LD"); - writeToTDB(m); - readFromTDB(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void writeToTDB(Model model){ - Location location = Location.create (TDB_DIRECTORY); - Dataset dataset = TDBFactory.createDataset(location); - dataset.begin(ReadWrite.WRITE); - try { - dataset.addNamedModel(OPEN_SABER_GRAPH, model); - dataset.commit(); - } catch (Exception e) { - e.printStackTrace(); - dataset.abort(); - } finally { - dataset.end(); - } - } - - public void readFromTDB(){ - - Location location = Location.create (TDB_DIRECTORY); - - String queryString = - "SELECT ?x ?y ?z" - + " WHERE { " - + "GRAPH <"+OPEN_SABER_GRAPH+"> { " - + "?x ?y ?z }}"; - - Dataset dataset = TDBFactory.createDataset(location); - dataset.begin(ReadWrite.READ); - try { - Query query = QueryFactory.create(queryString); - QueryExecution qexec = QueryExecutionFactory.create(query, dataset); - try { - ResultSet results = qexec.execSelect(); - while ( results.hasNext() ) { - QuerySolution soln = results.nextSolution(); - RDFNode rdfNode1 = soln.get("x"); - RDFNode rdfNode2 = soln.get("y"); - RDFNode rdfNode3 = soln.get("z"); - System.out.println("Subject:"+rdfNode1 + " " + "Predicate:"+rdfNode2 + " " + "Object:"+rdfNode3); - System.out.println(); - } - } finally { - qexec.close(); - } - } finally { - dataset.end(); - } - } - -} diff --git a/spikes/java/jena/src/main/java/org/opensaber/jena/poc/OwlReasoner.java b/spikes/java/jena/src/main/java/org/opensaber/jena/poc/OwlReasoner.java deleted file mode 100644 index f3e6e3097..000000000 --- a/spikes/java/jena/src/main/java/org/opensaber/jena/poc/OwlReasoner.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.opensaber.jena.poc; - -import org.apache.jena.rdf.model.InfModel; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.reasoner.Reasoner; -import org.apache.jena.reasoner.ReasonerRegistry; -import org.apache.jena.reasoner.ValidityReport; -import org.apache.jena.util.FileManager; - -public class OwlReasoner { - - private static final String VALID_INPUT_RDF = "testing/validTeacher.rdf"; - private static final String INVALID_INPUT_RDF1 = "testing/invalidTeacher1.rdf"; - private static final String INVALID_INPUT_RDF2 = "testing/invalidTeacher2.rdf"; - private static final String INPUT_OWL = "testing/teacher.owl"; - - - public static void main(String args[]){ - OwlReasoner owlReasoner = new OwlReasoner(); - owlReasoner.testingValidReasoner(); - owlReasoner.testingInvalidReasoner1(); - owlReasoner.testingInvalidReasoner2(); - } - - public void testingValidReasoner(){ - Model inputOwl = FileManager.get().loadModel(INPUT_OWL); - Reasoner reasoner = ReasonerRegistry.getOWLReasoner().bindSchema(inputOwl.getGraph()); - Model model = FileManager.get().loadModel(VALID_INPUT_RDF); - InfModel inference = ModelFactory.createInfModel(reasoner, model); - ValidityReport reportList = inference.validate(); - System.out.println("Is validTeacher.rdf schema valid as per input owl:"+reportList.isValid()); - } - - public void testingInvalidReasoner1(){ - Model inputOwl = FileManager.get().loadModel(INPUT_OWL); - Reasoner reasoner = ReasonerRegistry.getOWLReasoner().bindSchema(inputOwl.getGraph()); - Model model = FileManager.get().loadModel(INVALID_INPUT_RDF1); - InfModel inference = ModelFactory.createInfModel(reasoner, model); - ValidityReport reportList = inference.validate(); - System.out.println("Is invalidTeacher1.rdf schema valid as per input owl:"+reportList.isValid()); - } - - public void testingInvalidReasoner2(){ - Model inputOwl = FileManager.get().loadModel(INPUT_OWL); - Reasoner reasoner = ReasonerRegistry.getOWLReasoner().bindSchema(inputOwl.getGraph()); - Model model = FileManager.get().loadModel(INVALID_INPUT_RDF2); - InfModel inference = ModelFactory.createInfModel(reasoner, model); - ValidityReport reportList = inference.validate(); - System.out.println("Is invalidTeacher2.rdf schema valid as per input owl:"+reportList.isValid()); - } -} diff --git a/spikes/java/jena/testing/invalidTeacher1.rdf b/spikes/java/jena/testing/invalidTeacher1.rdf deleted file mode 100644 index 3943928c4..000000000 --- a/spikes/java/jena/testing/invalidTeacher1.rdf +++ /dev/null @@ -1,42 +0,0 @@ - - - -]> - - - - - - - 2011-12-06 - - - - Indian - - - - www.facebook.com/marvinpande419 - Marvin - b6ad2941-fac3-4c72-94b7-eb638538f55f - 1 - - - - - - - Pande - en - male - Teacher - - - diff --git a/spikes/java/jena/testing/invalidTeacher2.rdf b/spikes/java/jena/testing/invalidTeacher2.rdf deleted file mode 100644 index d35cd53d8..000000000 --- a/spikes/java/jena/testing/invalidTeacher2.rdf +++ /dev/null @@ -1,52 +0,0 @@ - - - - -]> - - - - - - - 2011-12-06 - - - - Indian - - - - www.facebook.com/marvinpande419 - Marvin - b6ad2941-fac3-4c72-94b7-eb638538f55f - hi - - - - - - - Pande - en - male - teacher - principal - - - - - diff --git a/spikes/java/jena/testing/teacher.json b/spikes/java/jena/testing/teacher.json deleted file mode 100644 index 0d167ab2d..000000000 --- a/spikes/java/jena/testing/teacher.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "@context": { - "schema": "http://schema.org", - "opensaber": "http://open-saber.org/vocab/core/#" - }, - "@id": "http://schema.org/person", - "@type": ["schema:Person","opensabre:Teacher"], - "schema:identifier": "b6ad2941-fac3-4c72-94b7-eb638538f55f", - "schema:image": null, - "schema:nationality": "Indian", - "schema:birthDate": "2011-12-06", - "schema:name": "Marvin", - "schema:gender": "male", - "schema:familyName": "Pande", - "opensaber:languagesKnownISO": [ - "en", - "hi" - ], - "opensaber:homeLocation": { - "@type": "opensaber:indianAddress", - "line1": "c/o Dr. Amit Pande", - "line2": "121, Sector 4", - "line3": "Urban Estate", - "poi": "near Tin factory", - "pincode": "122001" - }, - "opensaber:protectedProperty": - [ - { - "@type": "opensaber:consentURL", - "url": "https://open-saber/consent/b6ad2941-fac3-4c72-94b7-eb638538f55f/3edfr48jfsvfg5", - "request": "ConsentSeeker", - "response": "email", - "method": "POST", - "label": "Consent URL for Email" - }, - { - "@type": "opensaber:consentURL", - "url": "https://open-saber/consent/b6ad2941-fac3-4c72-94b7-eb638538f55f/3derkl8923ee2", - "request": "ConsentSeeker", - "response": "workLocation", - "method": "POST", - "label": "Consent URL for work location" - } - ], - "schema:sameAs":[ - "www.facebook.com/marvinpande419" - ], - "schema:hasOccupation": "Teacher", - "opensaber:teachingHistory":[ - { - "@type": "opensaber:teachingHistory", - "startDate": "2000-2-16", - "endDate": "2007-12-06", - "educationBoard": "CBSE", - "class":[{ - "subject": [ - "Physics" - ], - "grade":[ - "8","9","10" - ] - }], - "organization": { - "@type": "schema:EducationalOrganization", - "name": "DAVPS, Sector-14, Gurgaon", - "url": "https://davps14gurgaon.edu.in" - } - } - ] -} diff --git a/spikes/java/jena/testing/teacher.owl b/spikes/java/jena/testing/teacher.owl deleted file mode 100644 index a340fac49..000000000 --- a/spikes/java/jena/testing/teacher.owl +++ /dev/null @@ -1,35 +0,0 @@ - - - - - -]> - - - - - - - - 2 - - - - - - - - - - - diff --git a/spikes/java/jena/testing/validTeacher.rdf b/spikes/java/jena/testing/validTeacher.rdf deleted file mode 100644 index e2df99734..000000000 --- a/spikes/java/jena/testing/validTeacher.rdf +++ /dev/null @@ -1,36 +0,0 @@ - - - -]> - - - - 2011-12-06 - - - - Indian - - - - www.facebook.com/marvinpande419 - Marvin - b6ad2941-fac3-4c72-94b7-eb638538f55f - hi - - - - - - - Pande - en - male - Teacher - - -