Created
February 9, 2012 14:00
-
-
Save bblfish/1780147 to your computer and use it in GitHub Desktop.
pimp my rdf
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
package org.w3.rdf | |
import org.w3.algebraic._ | |
trait Module { | |
val xsdString = IRI("http://www.w3.org/2001/XMLSchema#string") | |
val rdfLangString = IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString") | |
trait GraphInterface extends Iterable[Triple] { self => | |
def ++(other: Graph): Graph | |
} | |
type Graph <: GraphInterface | |
type Triple | |
type Node | |
type IRI <: Node | |
type BNode <: Node | |
type Literal <: Node | |
type PlainLiteral <: TypedLiteral | |
type LangLiteral <: Literal | |
type TypedLiteral <: Literal | |
type Lang | |
trait GraphCompanionObject { | |
def empty: Graph | |
def apply(elems: Triple*): Graph | |
def apply(it: Iterable[Triple]): Graph | |
} | |
val Graph: GraphCompanionObject | |
val Triple: AlgebraicDataType3[Node, IRI, Node, Triple] | |
val IRI : AlgebraicDataType1[String, IRI] | |
val BNode: AlgebraicDataType1[String, BNode] | |
protected val Literal: AlgebraicDataType3[String, IRI, Option[Lang], Literal] | |
val PlainLiteral: AlgebraicDataType1[String, PlainLiteral] | |
val TypedLiteral: AlgebraicDataType2[String, IRI, TypedLiteral] | |
val LangLiteral: AlgebraicDataType2[String, Some[Lang], LangLiteral] | |
val Lang: AlgebraicDataType1[String, Lang] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment