Vadalingo is the translation layer that converts natural language descriptions, SQL queries, RDF data, and OWL ontologies into executable Vadalog rules. All paths are relative to the base URL and require authentication. All responses use the standard envelope.

Natural language → Vadalog

Translate a free-text description into a Vadalog program. The endpoint automatically loads every concept schema in the project to guide translation. Tag specific concepts with @concept_name in domain_knowledge to restrict context to only those schemas.
POST /vadalingo/{project_id}/translate/nl-to-vadalog
ParameterInRequiredDefaultDescription
project_idpathyesThe project ID.
domain_knowledgebodyyesNatural language description to translate. Reference a specific concept’s schema with @concept_name (e.g. "find all @owner records").

Example

curl -X POST "$BASE_URL/vadalingo/$PROJECT_ID/translate/nl-to-vadalog" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain_knowledge": "find all companies and their @owner for each location"
  }'
{
  "status": "success",
  "message": "Natural language to Vadalog translation completed successfully",
  "data": {
    "domain_knowledge": "find all companies and their @owner for each location",
    "vadalog_program": "@output(\"result\").\nresult(C, O, L) :- company(C, L), owner(C, O).",
    "project_id": "proj_123",
    "concepts_used": ["owner"],
    "concepts_source": "tagged"
  }
}
If no @ tags are present, all concept schemas in the project are passed as context. Tag specific concepts when you want to constrain the translation or when the project has many concepts and precision matters.

SQL → Vadalog

Translate a SQL query into an equivalent Vadalog program.
POST /vadalingo/{project_id}/translate/sql-to-vadalog
ParameterInRequiredDefaultDescription
project_idpathyesThe project ID.
sql_databodyyesSQL query string to translate.

Example

curl -X POST "$BASE_URL/vadalingo/$PROJECT_ID/translate/sql-to-vadalog" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sql_data": "SELECT company, location FROM employees WHERE role = '\''engineer'\''"
  }'
{
  "status": "success",
  "message": "SQL to Vadalog translation completed successfully",
  "data": {
    "sql_data": "SELECT company, location FROM employees WHERE role = 'engineer'",
    "vadalog_program": "@output(\"result\").\nresult(C, L) :- employees(C, L, \"engineer\").",
    "project_id": "proj_123"
  }
}

RDF → Vadalog

Translate RDF triples into Vadalog rules.
POST /vadalingo/{project_id}/translate/rdf-to-vadalog
ParameterInRequiredDefaultDescription
project_idpathyesThe project ID.
rdf_databodyyesRDF data as a string (Turtle, N-Triples, or other RDF serializations).

Example

curl -X POST "$BASE_URL/vadalingo/$PROJECT_ID/translate/rdf-to-vadalog" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rdf_data": "@prefix ex: <http://example.org/> .\nex:Alice ex:worksAt ex:Acme ."
  }'
{
  "status": "success",
  "message": "RDF to Vadalog translation completed successfully",
  "data": {
    "rdf_data": "@prefix ex: <http://example.org/> .\nex:Alice ex:worksAt ex:Acme .",
    "vadalog_program": "@output(\"worksAt\").\nworksAt(\"Alice\", \"Acme\").",
    "project_id": "proj_123"
  }
}

OWL → Vadalog

Translate an OWL ontology into Vadalog rules. Accepts RDF/XML, Turtle, N3, and N-Triples serializations. When data_base_path is provided, Parquet datasets are written under disk/ and @bind annotations are injected into the output program. When add_concepts is true, the resulting program is saved as a new concept named owl_to_vadalog in the project (overwriting any existing concept with that name).
POST /vadalingo/{project_id}/translate/owl-to-vadalog
ParameterInRequiredDefaultDescription
project_idpathyesThe project ID.
owl_contentbodyyesOWL ontology as a string (RDF/XML, Turtle, N3, or N-Triples).
base_namespacebodyyesBase namespace URI for resolving local classes and properties (e.g. "http://example.org/").
data_base_pathbodynoRelative path under disk/ for Parquet output (e.g. "owl"). When set alongside options.include_imports: true, Parquet data is written and @bind annotations are injected into the program.
options.include_importsbodynofalseProcess imported ontologies referenced in the OWL file.
options.include_schemabodynofalseAppend a schema documentation section to the Vadalog output.
options.include_not_rulesbodynofalseGenerate integrity constraint rules using negation.
add_conceptsbodynofalseSave the translated program as a concept named owl_to_vadalog in the project.

Example

curl -X POST "$BASE_URL/vadalingo/$PROJECT_ID/translate/owl-to-vadalog" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "owl_content": "<?xml version=\"1.0\"?><rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\">...</rdf:RDF>",
    "base_namespace": "http://example.org/",
    "data_base_path": "owl",
    "options": {
      "include_imports": true,
      "include_schema": false,
      "include_not_rules": false
    },
    "add_concepts": false
  }'
{
  "status": "success",
  "message": "OWL to Vadalog translation completed successfully (3 Parquet datasets saved to owl)",
  "data": {
    "owl_content_length": 1842,
    "base_namespace": "http://example.org/",
    "predicates": {
      "Person": ["id", "name"],
      "worksAt": ["person_id", "org_id"]
    },
    "rules": [
      "employee(P, O) :- worksAt(P, O), Person(P, _)."
    ],
    "vadalog_program": "@bind(\"Person\", \"parquet\", \"disk/owl/Person\").\n@output(\"employee\").\nemployee(P, O) :- worksAt(P, O), Person(P, _).",
    "data_bindings": [
      { "predicate": "Person", "path": "disk/owl/Person" }
    ],
    "saved_data_files": ["disk/owl/Person", "disk/owl/worksAt", "disk/owl/Organization"],
    "metadata": { "class_count": 2, "property_count": 1 },
    "project_id": "proj_123",
    "concept_id": null
  }
}
concept_id is null unless add_concepts is true, in which case it contains the ID of the saved or updated concept.