SANSA-Stack/Archived-SANSA-OWL

Genrating axioms in DL format

sbhttchryy opened this issue · 2 comments

Is there a way to generate axioms in DL format?

Hi @sbhttchryy !

No, right now there is no way to write axioms in DL format. However we can add this to our feature wish list, if you need it.

Best regards,
Patrick

Hi again,

I added a DL syntax writer. It is currently held in the feature/owl-writer branch. When I'm done with the writers for the other common formats I'll merge it to the develop branch s.t. it will be part of the next release in June.

Usage is as sketched below.

import net.sansa_stack.owl.spark.owl._

val spark = SparkSession.builder
  .appName("OWL writer example")
  .master("local[*]")
  .config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
  .getOrCreate()

val data = spark.owl(Syntax.FUNCTIONAL)("/path/to/input/file")

val docFormat = new DLSyntaxDocumentFormat()
data.save("/output/dir/", docFormat)

Thanks for your input and best regards,
Patrick