Commit 8031aa5f authored by Robin Knapp's avatar Robin Knapp

wip: ld conversion

parent 6cbcc7b4
......@@ -11,7 +11,7 @@ import requests
from flask import current_app, redirect, request
from werkzeug.exceptions import HTTPException
from src.logic import ValidationException, ValidationLogic
from src.logic import ValidationException, ValidationLogic, FiwareElement
class Connector(object):
......@@ -358,8 +358,8 @@ class Converter(object):
raise ValidationException(extern=f'LD-Model must contain `@context attribute`', module=__name__,
func='Converter.convert_ld_to_kv')
val = ValidationLogic(None, None, None)
val.parse_expression(expression=f'FiwareElement({blueprint["@context"]["type"].lower()}={ld_model["@context"]}')
# single validation for @context attribute, delete afterwards if successful
FiwareElement(structuredvalue=ld_model["@context"])
ld_model.pop('@context')
# iterate model and check attributes with blueprints & add attributes to kv-model
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment