Skip to content

OWL notebook

Gezim Sejdiu edited this page Feb 12, 2018 · 1 revision

SANSA OWL is a library to read OWL files into Spark. It allows files to reside in HDFS as well as in a local file system and distributes them across Spark RDDs/Datasets. SANSA OWL Spark mainly contains builder objects to read OWL files in different formats. Currently, we support Functional Syntax and Manchester Syntax. Parsing support for OWL XML is planned for future releases. Besides this, we also work on building OWL axioms from other RDF formats like Turtle or N-Triples.

Dataset OWL reader example (Functional syntax)

import net.sansa_stack.owl.spark.dataset.FunctionalSyntaxOWLAxiomsDatasetBuilder

val input = "hdfs://namenode:8020/data/ont_functional.owl"
val dataset = FunctionalSyntaxOWLAxiomsDatasetBuilder.build(spark, input)

dataset.take(10).foreach(println(_))

Dataset OWL reader example (Manchester syntax)

import net.sansa_stack.owl.spark.dataset.ManchesterSyntaxOWLAxiomsDatasetBuilder

val input = "hdfs://namenode:8020/data/ont_manchester.owl"
val dataset = ManchesterSyntaxOWLAxiomsDatasetBuilder.build(spark, input)

dataset.take(10).foreach(println(_))