What Formats Can Semantica Export Knowledge Graphs To? A Complete 2024 Guide
Semantica can export knowledge graphs to 12+ formats including RDF (Turtle, RDF/XML, JSON-LD, N-Triples, N3), JSON/JSON-LD, CSV, GraphML/GEXF/DOT, YAML, OWL, Parquet, vector embeddings, LPG/Cypher, ArangoDB AQL, Neo4j bulk CSV, and Apache Arrow.
Semantica's export system uses a method-registry architecture that maps high-level export commands to concrete exporter classes. Each exporter implements one or more serialization formats, enabling seamless integration with semantic web tools, graph databases, data lakes, and ML pipelines. The supported formats are documented in semantica/export/__init__.py (lines 4-7) and implemented across 13 specialized exporter modules.
Semantic Web and RDF Formats
RDF Family (Turtle, RDF/XML, JSON-LD, N-Triples, N3)
The RDFExporter class in [semantica/export/rdf_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/rdf_exporter.py) handles all W3C-standard RDF serializations:
from semantica.export.methods import export_rdf
# Turtle (default, human-readable)
export_rdf(my_kg, "graph.ttl", format="turtle")
# RDF/XML for legacy systems
export_rdf(my_kg, "graph.rdf", format="xml")
# JSON-LD for web APIs
export_rdf(my_kg, "graph.jsonld", format="json-ld")
# N-Triples for line-by-line processing
export_rdf(my_kg, "graph.nt", format="ntriples")
# N3 for logic rules
export_rdf(my_kg, "graph.n3", format="n3")
OWL Ontology Formats
The OWLExporter in [semantica/export/owl_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/owl_exporter.py) supports OWL-XML and Turtle OWL for ontology exchange:
- OWL-XML: Standard XML serialization for OWL 2 ontologies
- Turtle OWL: Compact textual representation for TBox/ABox data
JSON and Document Formats
JSON and JSON-LD
The JSONExporter in [semantica/export/json_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/json_exporter.py) provides two modes:
from semantica.export.methods import export_json
# Plain JSON (entities and relationships as nested objects)
export_json(my_kg, "graph.json")
# JSON-LD with @context for semantic markup
export_json(my_kg, "graph.jsonld", format="json-ld")
The JSON-LD output includes a proper @context mapping for schema.org or custom vocabularies.
YAML
Human-readable YAML export for semantic networks and schemas is handled by YAMLExporter in [semantica/export/yaml_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/yaml_exporter.py). Ideal for:
- Configuration management
- Version-controlled ontology development
- Documentation and review workflows
Tabular and Analytical Formats
CSV
The CSVExporter in [semantica/export/csv_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/csv_exporter.py) generates separate tables for entities and relationships:
from semantica.export.methods import export_csv
export_csv(my_kg, "output_dir/") # Creates entities.csv + relationships.csv
Parquet with Arrow Schema
For analytics workloads, ParquetExporter in [semantica/export/parquet_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/parquet_exporter.py) writes columnar files with embedded Arrow schema:
from semantica.export.methods import export_parquet
export_parquet(my_kg, "graph.parquet", compression="snappy") # "zstd", "gzip", "none"
Apache Arrow IPC
The ArrowExporter in [semantica/export/arrow_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/arrow_exporter.py) provides Arrow IPC files for zero-copy data sharing between Python, R, Julia, and Rust. Includes a fallback stub when Arrow is unavailable.
Graph Visualization and Network Formats
GraphML, GEXF, and DOT
The GraphExporter in [semantica/export/graph_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/graph_exporter.py) supports three visualization formats:
from semantica.export.methods import export_graph
export_graph(my_kg, "graph.graphml", format="graphml") # Gephi, yEd, Cytoscape
export_graph(my_kg, "graph.gexf", format="gexf") # Gephi streaming
export_graph(my_kg, "graph.dot", format="dot") # GraphViz rendering
Vector Embedding Formats
For ML pipelines, VectorExporter in [semantica/export/vector_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/vector_exporter.py) handles knowledge graph embeddings:
from semantica.export.methods import export_vector
export_vector(my_embeddings, "vectors.json", format="json") # Interoperability
export_vector(my_embeddings, "vectors.npy", format="numpy") # NumPy arrays
export_vector(my_embeddings, "vectors.faiss", format="faiss") # FAISS index
export_vector(my_embeddings, "vectors.bin", format="binary") # Raw bytes
Graph Database Native Formats
Labeled Property Graph (LPG) and Cypher
The LPGExporter in [semantica/export/lpg_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/lpg_exporter.py) generates Cypher queries for Neo4j and Memgraph:
from semantica.export.methods import export_lpg
export_lpg(my_kg, "graph.cypher", method="cypher") # CREATE/MERGE statements
Neo4j Bulk Import CSV
For high-performance Neo4j ingestion, Neo4jCSVExporter in [semantica/export/neo4j_csv_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/neo4j_csv_exporter.py) creates deterministic CSV files compatible with neo4j-admin import:
from semantica.export.methods import export_neo4j_csv
paths = export_neo4j_csv(my_kg, "neo4j_import/")
print(paths["nodes"]) # neo4j_import/nodes.csv
print(paths["relationships"]) # neo4j_import/relationships.csv
ArangoDB AQL
The ArangoAQLExporter in [semantica/export/arango_aql_exporter.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/arango_aql_exporter.py) generates AQL INSERT statements for multi-model ArangoDB deployments.
Master Registry and Extension Points
The central dispatch system lives in [semantica/export/methods.py](https://github.com/semantica-agi/semantica/blob/main/semantica/export/methods.py). The export_knowledge_graph function delegates to registered exporters based on the format parameter:
from semantica.export.methods import export_knowledge_graph
# Generic dispatch
export_knowledge_graph(my_kg, "output", format="turtle")
The method_registry dictionary can be extended with custom handlers without modifying core code.
Summary
- RDF standards: Turtle, RDF/XML, JSON-LD, N-Triples, N3 via
RDFExporter - Web formats: JSON, JSON-LD, YAML via
JSONExporterandYAMLExporter - Analytics: CSV, Parquet, Arrow via
CSVExporter,ParquetExporter,ArrowExporter - Visualization: GraphML, GEXF, DOT via
GraphExporter - ML pipelines: JSON, NumPy, FAISS, binary via
VectorExporter - Graph databases: Cypher/LPG, Neo4j bulk CSV, ArangoDB AQL via
LPGExporter,Neo4jCSVExporter,ArangoAQLExporter - Ontologies: OWL-XML, Turtle OWL via
OWLExporter
Frequently Asked Questions
Does Semantica support streaming export for large knowledge graphs?
The Parquet and CSV exporters support chunked writing through their underlying libraries. The Neo4j CSV exporter specifically generates deterministic, split files suitable for parallel bulk import. For true streaming RDF output, wrap the RDFExporter with a custom generator.
Can I extend Semantica with a custom export format?
Yes. Register a new exporter class by adding an entry to the method_registry in semantica/export/methods.py. Your class must implement the standard exporter interface (typically export(knowledge_graph, path, **options)). See existing implementations like yaml_exporter.py for the minimal required structure.
Which format should I choose for Neo4j ingestion?
Use export_neo4j_csv for initial bulk loads exceeding millions of nodes—it's optimized for neo4j-admin import. Use export_lpg with method="cypher" for incremental updates or when running Cypher directly against a live database.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →