What Formats Can Semantica Export Data To? Complete Export Format Reference

Semantica supports over 20 distinct export formats spanning RDF serializations (Turtle, JSON-LD), graph exchange formats (GraphML, GEXF, Cypher), columnar storage (Parquet, Apache Arrow), vector embeddings (FAISS, NumPy), and database-specific imports (Neo4j CSV, ArangoDB AQL), all accessible through the unified export_knowledge_graph dispatcher.

The semantica-agi/semantica repository implements a registry-based export architecture centered in semantica/export/methods.py. This design allows the high-level export_knowledge_graph helper (lines 92–111) to automatically route knowledge graphs, ontologies, and vector data to the correct serializer based on file extension or explicit format arguments.

Semantic Web and Linked Data Formats

Semantica provides comprehensive support for W3C semantic web standards through dedicated exporters in semantica/export/rdf_exporter.py and semantica/export/owl_exporter.py.

  • RDF Serializations — Export to turtle, rdfxml, ntriples, and n3 (Notation3) via the RDF Exporter (registered around lines 9–17 in methods.py).
  • JSON-LD — Available as jsonld through the RDF exporter or json-ld through the JSON Exporter (semantica/export/json_exporter.py, lines 18–22), providing Linked Data compatible output.
  • OWL Ontologies — Serialize schemas to owl-xml or turtle formats using the OWL Exporter (lines 36–39), optimized for ontology exchange with Protégé and other OWL tools.

Tabular and Columnar Storage Formats

For analytics pipelines and data science workflows, Semantica supports efficient binary and text-based tabular formats:

  • CSV — Standard comma-separated output for entities and relationships via semantica/export/csv_exporter.py (lines 22–28), compatible with pandas and Excel.
  • Apache Arrow — Zero-copy IPC format (arrow) for high-performance data exchange between Python, R, and Julia (around lines 40–46).
  • Apache Parquet — Compressed columnar storage (parquet) ideal for data lakes and warehouse ingestion (lines 84–92), with configurable compression codecs.

Graph Visualization and Exchange Formats

Visualization tools and graph databases receive native support through semantica/export/graph_exporter.py and specialized database exporters:

  • GraphML and GEXF — Standard XML formats for Gephi and network analysis tools (graphml, gexf).
  • Graphviz DOT — Generation of dot files for rendering directed graphs with Graphviz.
  • JSON Graph — Lightweight JSON representation of nodes and edges for web-based visualizations.
  • Labeled Property Graph (LPG) — Raw lpg format and cypher query scripts for Neo4j bulk operations via semantica/export/lpg_exporter.py.

Database Import Formats

Semantica generates deterministic import files for popular graph databases without requiring live connections:

Vector and Machine Learning Formats

Vector embeddings export to specialized formats for similarity search and ML pipelines through semantica/export/vector_exporter.py:

  • FAISS — Native faiss index format for Facebook AI Similarity Search, supporting efficient billion-scale similarity queries.
  • NumPy Arrays — Binary .npy files (numpy) for direct loading into scikit-learn and PyTorch.
  • Raw Binary — Compact binary format for custom vector store implementations.
  • JSON Vectors — Human-readable json representation for debugging small embedding sets.

Configuration and Documentation Formats

Human-readable and configuration formats support schema documentation and reporting:

Export System Architecture

The export layer employs a method registry pattern where each format maps to a specific exporter class. When export_knowledge_graph(data, filename, format=None) is invoked (lines 92–111 of semantica/export/methods.py), the function inspects the file extension or format parameter to select the appropriate exporter from the registry. This extensible design allows new formats to be added by implementing a new exporter class and registering it in the central registry without modifying the high-level API.

Practical Code Examples

from semantica.export.methods import export_knowledge_graph

# Export knowledge graph to Turtle RDF for semantic web integration

export_knowledge_graph(kg, "ontology.ttl", format="turtle")

# Generate GraphML for visualization in Gephi

export_knowledge_graph(kg, "network.graphml", format="graphml")

# Create Neo4j bulk import CSV files

export_knowledge_graph(kg, "nodes.csv", format="neo4j_csv")

# Export vector embeddings to FAISS index

export_knowledge_graph(embeddings, "index.faiss", format="faiss")

# Generate Markdown documentation report

export_knowledge_graph(kg, "report.md", format="markdown")

Summary

  • Semantica exports to 20+ formats across six categories: RDF, tabular, graph visualization, database imports, vectors, and documentation.
  • Central dispatch occurs through export_knowledge_graph in semantica/export/methods.py, which auto-detects formats by file extension.
  • Database formats include Neo4j CSV, Cypher scripts, and ArangoDB AQL for offline bulk imports.
  • Vector formats support FAISS, NumPy, and binary serialization for ML workflows.
  • Extensible registry allows custom exporters to integrate seamlessly with the existing format parameter.

Frequently Asked Questions

What is the difference between JSON and JSON-LD export in Semantica?

The standard json format produces plain JSON via semantica/export/json_exporter.py, while jsonld (or json-ld) produces JSON-LD via either the JSON exporter or semantica/export/rdf_exporter.py. JSON-LD includes semantic context and vocabulary mappings required for linked data applications, whereas plain JSON provides a simpler structural representation without RDF semantics.

Does Semantica export directly to Neo4j or generate import files?

Semantica generates import files rather than maintaining live database connections. The cypher format produces Cypher query scripts, while neo4j_csv generates deterministic CSV files compatible with the Neo4j Admin import command. These files are created through semantica/export/lpg_exporter.py and semantica/export/neo4j_csv_exporter.py respectively.

How can I add a custom export format to Semantica?

Implement a new exporter class following the existing pattern in semantica/export/methods.py, then register it in the method registry (around lines 9–92). Once registered, the export_knowledge_graph dispatcher automatically recognizes the new format via the format parameter or file extension without requiring changes to the public API.

Which format is best for large-scale knowledge graphs?

For analytics and data science workflows, use parquet for compressed columnar storage or arrow for inter-process communication. For semantic web archiving, turtle provides a balance of readability and compression. For graph database migration, neo4j_csv offers the fastest bulk import performance into Neo4j.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →