@startuml
allow_mixing
skinparam ranksep 15
skinparam Padding .1

package "core" <<rectangle>>
{
	component "model" as model
	
	component "obda-core" as obda_core
	obda_core ..> model
	
	component "optimization" as optimization
	optimization ..> model
}

package "db" <<rectangle>>
{
	component "rdb" as rdb
	rdb .[hidden].> obda_core
}
"db" .> obda_core

package "mapping" <<rectangle>>
{
	component "mapping-core" as mapping_core
	mapping_core .[hidden].> obda_core
	mapping_core .[hidden].> optimization

	package "ontology" <<rectangle>>
	{
		component "ontology-owlapi" as ontology_owlapi
		ontology_owlapi .[hidden].> mapping_core
		ontology_owlapi .[hidden].> rdb
	}
	"ontology" .> mapping_core
	"ontology" .> "db"
	
	component "mapping-owlapi" as mapping_owlapi #FFFFFF
	mapping_owlapi .[hidden].> ontology_owlapi
	mapping_owlapi .> "ontology"

	package "mapping/sql" <<rectangle>>
	{
		component "mapping-sql-core" as mapping_sql_core
		mapping_sql_core .[hidden].> mapping_core
		mapping_sql_core .[hidden].> rdb
		
		component "mapping-native" as mapping_native
		mapping_native ..> mapping_sql_core
		
		component "mapping-r2rml" as mapping_r2rml
		mapping_r2rml ..> mapping_native
		
		component "mapping-sql-all" as mapping_sql_all #FFFFFF
		mapping_sql_all ..> mapping_r2rml
		
		component "mapping-sql-owlapi" as mapping_sql_owlapi
		mapping_sql_owlapi ..> mapping_sql_all
		mapping_sql_owlapi ..> mapping_owlapi
	}
	"mapping/sql" .> mapping_core
	"mapping/sql" .> "db"
}
"mapping" .> "core"

package "engine" <<rectangle>>
{
	package "engine/reformulation" <<rectangle>>
	{
		component "reformulation-core" as reformulation_core
		reformulation_core .[hidden].> obda_core
		reformulation_core .[hidden].> optimization
		reformulation_core .[hidden].> "core"
		
		component "reformulation-sql" as reformulation_sql
		reformulation_sql ..> reformulation_core
		reformulation_sql .[hidden].> rdb
		reformulation_sql .> "db"
	}
	
	package "engine/system" <<rectangle>>
	{
		component "system-core" as system_core
		system_core .[hidden].> reformulation_core
		
		component "system-owlapi" as system_owlapi #FFFFFF
		system_owlapi ..> system_core
		system_owlapi .[hidden].> ontology_owlapi
		system_owlapi .> "ontology"
		
		package "engine/system/sql" <<rectangle>>
		{
			component "system-sql-core" as system_sql_core
			system_sql_core .[hidden].> system_core
			system_sql_core .[hidden].> reformulation_sql
			system_sql_core .[hidden].> mapping_sql_all
		
			component "system-sql-owlapi" as system_sql_owlapi #FFFFFF
			system_sql_owlapi ..> system_sql_core
			system_sql_owlapi ..> system_owlapi
			system_sql_owlapi .[hidden].> mapping_sql_owlapi
			system_sql_owlapi .> "mapping/sql"
		}
		"engine/system/sql" .> system_core
		"engine/system/sql" .> "engine/reformulation"
		"engine/system/sql" .> mapping_sql_all
	}
	"engine/system" .> reformulation_core
}
"engine" .> "core"

package "binding" <<rectangle>>
{
	component "owlapi" as owlapi
	owlapi ..> system_owlapi
	
	component "rdf4j" as rdf4j
	rdf4j .[hidden].> system_core
}
"binding" .> system_core

package "client" <<rectangle>>
{
	component "endpoint\n<i>(no owlapi)</i>" as endpoint
	endpoint .[hidden].> rdf4j
	endpoint .[hidden].> system_sql_owlapi

	component "cli" as cli
	cli ..> endpoint
	cli .[hidden].> owlapi
	
	component "protege" as protege
	protege .[hidden].> system_sql_owlapi
	protege .[hidden].> owlapi
	protege .[hidden].> rdf4j

	package "client/rdf4j_webapps" <<rectangle>>
	{
		component "rdf4j-config-sql\n<i>(no owlapi)</i>" as rdf4j_config_sql
		rdf4j_config_sql .[hidden].> rdf4j
		rdf4j_config_sql .[hidden].> system_sql_owlapi
		
		component "rdf4j-server" as rdf4j_server #FFFFFF
		rdf4j_server ..> rdf4j_config_sql
		
		component "rdf4j-workbench" as rdf4j_workbench #FFFFFF
		rdf4j_workbench ..> rdf4j_config_sql
	}
}
"client" .> "binding"
"client" .> "engine"

package "test" <<rectangle>>
{
	component "docker-tests" as docker_tests
	docker_tests .[hidden].> system_sql_owlapi
	docker_tests .[hidden].> owlapi
	docker_tests .[hidden].> rdf4j
	
	component "rdb2rdf-\ncompliance\n<i>(no owlapi)</i>" as rdb2rdf_compliance
	rdb2rdf_compliance .[hidden].> rdf4j
	rdb2rdf_compliance .[hidden].> system_sql_owlapi

	component "semantic-index" as semantic_index
	semantic_index .[hidden].> owlapi
	semantic_index .[hidden].> rdf4j
	semantic_index .[hidden].> system_sql_owlapi
	
	component "sparql-compliance" as sparql_compliance
	sparql_compliance ..> semantic_index
}
"test" .> "engine"
"test" .> "binding"

package "build" <<rectangle>>
{
	component "distribution" as distribution #FFFFFF
	distribution .[hidden].> owlapi
	distribution .[hidden].> rdf4j
	distribution .[hidden].> cli
}
"build" .> "binding"
"build" .> cli

@enduml