forked from Sunbird-RC/sunbird-rc-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
2,280 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'json-ld' | ||
gem 'rdf-reasoner' | ||
gem 'rdf-turtle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"@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" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"@context": { | ||
"schema": "http://schema.org", | ||
"opensaber": "http://open-saber.org/vocab/core/#" | ||
}, | ||
"@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", //think | ||
"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" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"@context": { | ||
"dct": "http://purl.org/dc/terms/", | ||
"owl": "http://www.w3.org/2002/07/owl#", | ||
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", | ||
"rdfa": "http://www.w3.org/ns/rdfa#", | ||
"rdfs": "http://www.w3.org/2000/01/rdf-schema#", | ||
"schema": "http://schema.org/", | ||
"xsd": "http://www.w3.org/2001/XMLSchema#" | ||
}, | ||
"@graph": | ||
[ | ||
{ | ||
"@id": "schema:identifier", | ||
"@type": "rdf:Property", | ||
"owl:equivalentProperty": { | ||
"@id": "dct:identifier" | ||
}, | ||
"rdfs:comment": "The identifier property represents any kind of identifier for any kind of <a class=\"localLink\" href=\"http://schema.org/Thing\">Thing</a>, such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See <a href=\"/docs/datamodel.html#identifierBg\">background notes</a> for more details.", | ||
"rdfs:label": "identifier", | ||
"schema:domainIncludes": { | ||
"@id": "schema:Thing" | ||
}, | ||
"schema:rangeIncludes": [ | ||
{ | ||
"@id": "schema:Text" | ||
}, | ||
{ | ||
"@id": "schema:PropertyValue" | ||
}, | ||
{ | ||
"@id": "schema:URL" | ||
} | ||
] | ||
}, | ||
{ | ||
"@id": "schema:image", | ||
"@type": "rdf:Property", | ||
"rdfs:comment": "An image of the item. This can be a <a class=\"localLink\" href=\"http://schema.org/URL\">URL</a> or a fully described <a class=\"localLink\" href=\"http://schema.org/ImageObject\">ImageObject</a>.", | ||
"rdfs:label": "avataar", | ||
"schema:domainIncludes": { | ||
"@id": "schema:Thing" | ||
}, | ||
"schema:rangeIncludes": [ | ||
{ | ||
"@id": "schema:ImageObject" | ||
}, | ||
{ | ||
"@id": "schema:URL" | ||
} | ||
] | ||
}, | ||
{ | ||
"@id": "schema:name", | ||
"@type": "rdf:Property", | ||
"rdfs:comment": "The name of the teacher.", | ||
"rdfs:label": "name", | ||
"schema:domainIncludes": { | ||
"@id": "schema:Thing" | ||
}, | ||
"schema:rangeIncludes": { | ||
"@id": "schema:Text" | ||
} | ||
} | ||
] | ||
} |
Empty file.