example RDF Jena

schema S = literal : sql {
	entities
		Employee
		Department
	foreign_keys
		manager   : Employee -> Employee
		worksIn   : Employee -> Department
		secretary : Department -> Employee
	path_equations
		Employee.manager.worksIn = Employee.worksIn
  		Department.secretary.worksIn = Department
  	attributes
  		first last	: Employee -> String
     	age			: Employee -> Integer
     	name 		: Department -> String
}

instance I = literal : S {
	generators
		a b c : Employee
		m s : Department
	equations
		first(a) = Al
		first(b) = Bob  last(b) = Bo
		first(c) = Carl
		name(m)  = Math name(s) = CS
		age(a) = age(c)
		manager(a) = b manager(b) = b manager(c) = c
		worksIn(a) = m worksIn(b) = m worksIn(c) = s
		secretary(s) = c secretary(m) = b
		secretary(worksIn(a)) = manager(a)
		worksIn(a) = worksIn(manager(a))
		age(a) = "2"
		age(manager(a)) = "1"
}

command exportRdfData = export_rdf_instance_xml I "file.xml" {
	external_types
		Integer -> "http://www.w3.org/2001/XMLSchema#Integer" "x => x.toString()"
}

instance J = import_rdf_all "file.xml" #can import from .ttl too

instance K = spanify J
Keywords:

schema_literal
export_rdf_instance_xml
spanify
import_rdf_all
instance_literal

Options:




instance I

Department
IDnamesecretary
0Math3
1CS4
Employee
IDagefirstlastmanagerworksIn
22Al?030
31BobBo30
42Carl?141


instance J

R
IDobjectpredicatesubject
0cql://entity/Departmenthttp://www.w3.org/2000/01/rdf-schema#domaincql://foreign_key/secretary
1cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#rangecql://foreign_key/secretary
2http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertyhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://foreign_key/secretary
3Optional[CS]cql://attribute/name?0
4?1cql://foreign_key/secretary?0
5cql://entity/Departmenthttp://www.w3.org/1999/02/22-rdf-syntax-ns#type?0
6cql://entity/Departmenthttp://www.w3.org/2000/01/rdf-schema#domaincql://attribute/name
7http://www.w3.org/2001/XMLSchema#Stringhttp://www.w3.org/2000/01/rdf-schema#rangecql://attribute/name
8http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertyhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/name
9Optional[Carl]cql://attribute/first?1
10Optional[2]cql://attribute/age?1
11?1cql://foreign_key/manager?1
12?0cql://foreign_key/worksIn?1
13cql://entity/Employeehttp://www.w3.org/1999/02/22-rdf-syntax-ns#type?1
14http://www.w3.org/2000/01/rdf-schema#Classhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Department
15cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#domaincql://attribute/first
16http://www.w3.org/2001/XMLSchema#Stringhttp://www.w3.org/2000/01/rdf-schema#rangecql://attribute/first
17http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertyhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/first
18Optional[Al]cql://attribute/first?2
19Optional[2]cql://attribute/age?2
20?3cql://foreign_key/manager?2
21?4cql://foreign_key/worksIn?2
22cql://entity/Employeehttp://www.w3.org/1999/02/22-rdf-syntax-ns#type?2
23cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#domaincql://foreign_key/worksIn
24cql://entity/Departmenthttp://www.w3.org/2000/01/rdf-schema#rangecql://foreign_key/worksIn
25http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertyhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://foreign_key/worksIn
26http://www.w3.org/2000/01/rdf-schema#Classhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Employee
27cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#domaincql://attribute/age
28http://www.w3.org/2001/XMLSchema#Integerhttp://www.w3.org/2000/01/rdf-schema#rangecql://attribute/age
29http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertyhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/age
30Optional[Bob]cql://attribute/first?3
31Optional[Bo]cql://attribute/last?3
32Optional[1]cql://attribute/age?3
33?3cql://foreign_key/manager?3
34?4cql://foreign_key/worksIn?3
35cql://entity/Employeehttp://www.w3.org/1999/02/22-rdf-syntax-ns#type?3
36Optional[Math]cql://attribute/name?4
37?3cql://foreign_key/secretary?4
38cql://entity/Departmenthttp://www.w3.org/1999/02/22-rdf-syntax-ns#type?4
39cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#domaincql://foreign_key/manager
40cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#rangecql://foreign_key/manager
41http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertyhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://foreign_key/manager
42cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#domaincql://attribute/last
43http://www.w3.org/2001/XMLSchema#Stringhttp://www.w3.org/2000/01/rdf-schema#rangecql://attribute/last
44http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertyhttp://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/last


instance K

cql://attribute/age
IDobjectsubject
0Optional[2]?0
1Optional[2]?1
2Optional[1]?2
cql://attribute/first
IDobjectsubject
3Optional[Carl]?0
4Optional[Al]?1
5Optional[Bob]?2
cql://attribute/last
IDobjectsubject
6Optional[Bo]?2
cql://attribute/name
IDobjectsubject
7Optional[CS]?3
8Optional[Math]?4
cql://foreign_key/manager
IDobjectsubject
9?0?0
10?2?1
11?2?2
cql://foreign_key/secretary
IDobjectsubject
12?0?3
13?2?4
cql://foreign_key/worksIn
IDobjectsubject
14?3?0
15?4?1
16?4?2
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
IDobjectsubject
17http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertycql://foreign_key/secretary
18cql://entity/Department?3
19http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertycql://attribute/name
20cql://entity/Employee?0
21http://www.w3.org/2000/01/rdf-schema#Classcql://entity/Department
22http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertycql://attribute/first
23cql://entity/Employee?1
24http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertycql://foreign_key/worksIn
25http://www.w3.org/2000/01/rdf-schema#Classcql://entity/Employee
26http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertycql://attribute/age
27cql://entity/Employee?2
28cql://entity/Department?4
29http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertycql://foreign_key/manager
30http://www.w3.org/1999/02/22-rdf-syntax-ns#Propertycql://attribute/last
http://www.w3.org/2000/01/rdf-schema#domain
IDobjectsubject
31cql://entity/Departmentcql://foreign_key/secretary
32cql://entity/Departmentcql://attribute/name
33cql://entity/Employeecql://attribute/first
34cql://entity/Employeecql://foreign_key/worksIn
35cql://entity/Employeecql://attribute/age
36cql://entity/Employeecql://foreign_key/manager
37cql://entity/Employeecql://attribute/last
http://www.w3.org/2000/01/rdf-schema#range
IDobjectsubject
38cql://entity/Employeecql://foreign_key/secretary
39http://www.w3.org/2001/XMLSchema#Stringcql://attribute/name
40http://www.w3.org/2001/XMLSchema#Stringcql://attribute/first
41cql://entity/Departmentcql://foreign_key/worksIn
42http://www.w3.org/2001/XMLSchema#Integercql://attribute/age
43cql://entity/Employeecql://foreign_key/manager
44http://www.w3.org/2001/XMLSchema#Stringcql://attribute/last


command exportRdfData

Size 45