| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- """
- Root of the ModelVerse State package
- """
- # Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
- # at the University of Antwerp (http://msdl.uantwerpen.be/).
- #
- # Licensed under the GNU Public License v3 (the "License");
- # you may not use this file except in compliance with the
- # License. You may obtain a copy of the License at
- # https://www.gnu.org/licenses/gpl-3.0.en.html
- #
- # Unless required by applicable law or agreed to in writing,
- # software distributed under the License is distributed on an
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- # either express or implied. See the License for the specific
- # language governing permissions and limitations under the
- # License.
- from enum import Enum
- class MvSKernel(Enum):
- PYTHON = 0
- RDF = 1
- NEO4J = 2
- IGRAPH = 3
- def getMvSBackend(type, *args, **kwargs):
- """
- Obtains a state implementation for the ModelVerse State.
- Args:
- type (MvSKernel): The type of backend to use.
- All other arguments are implementation-specific.
- """
- if type == MvSKernel.PYTHON:
- from .pystate import PyState
- return PyState()
- elif type == MvSKernel.RDF:
- from .rdfstate import RDFState
- return RDFState(*args, **kwargs)
- elif type == MvSKernel.NEO4J:
- from .neo4jstate import Neo4jState
- return Neo4jState(*args, **kwargs)
- elif type == MvSKernel.IGRAPH:
- from .igraphstate import iGraphState
- return iGraphState()
|