Skip to content
This repository was archived by the owner on Oct 8, 2020. It is now read-only.

Commit f45da8b

Browse files
RDF structures
1 parent 0c9296b commit f45da8b

4 files changed

Lines changed: 93 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package net.sansa_stack.inference.data
2+
3+
import org.apache.jena.graph.{ Graph => JenaGraph, Node => JenaNode, Triple => JenaTriple, _ }
4+
5+
/**
6+
* Defines the types related to the RDF datamodel in the Apache Jena framework.
7+
*
8+
* This class is inspired by the Banana-RDF project.
9+
*
10+
* @author Lorenz Buehmann
11+
*/
12+
trait Jena extends RDF {
13+
type Graph = JenaGraph
14+
type Triple = JenaTriple
15+
type Node = JenaNode
16+
type URI = Node_URI
17+
type BNode = Node_Blank
18+
type Literal = Node_Literal
19+
type Lang = String
20+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package net.sansa_stack.inference.data
2+
3+
/**
4+
* Defines the types related to the RDF datamodel.
5+
*
6+
* This class is inspired by the Banana-RDF project.
7+
8+
* @author Lorenz Buehmann
9+
*/
10+
trait RDF {
11+
12+
/**
13+
* An RDF graph
14+
*/
15+
type Graph
16+
/**
17+
* An RDF triple
18+
*/
19+
type Triple
20+
/**
21+
* An RDF node
22+
*/
23+
type Node
24+
25+
type URI <: Node
26+
/**
27+
* An RDF blank node
28+
*/
29+
type BNode <: Node
30+
/**
31+
* An RDF literal
32+
*/
33+
type Literal <: Node
34+
/**
35+
* The language tag used in RDF literals
36+
*/
37+
type Lang
38+
39+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package net.sansa_stack.inference.data
2+
3+
/**
4+
* @author Lorenz Buehmann
5+
*/
6+
class SimpleRDF extends RDF {
7+
type Triple = RDFTriple
8+
type Node = String
9+
type URI = String
10+
type BNode = String
11+
type Literal = String
12+
type Lang = String
13+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package net.sansa_stack.inference.data
2+
3+
/**
4+
* @author Lorenz Buehmann
5+
*/
6+
trait TripleOps[Rdf <: RDF] {
7+
8+
/**
9+
* @return the subject
10+
*/
11+
def s: Rdf#Node
12+
/**
13+
* @return the predicate
14+
*/
15+
def p: Rdf#URI
16+
/**
17+
* @return the object
18+
*/
19+
def o: Rdf#Node
20+
21+
}

0 commit comments

Comments
 (0)