def post(self): title = request.json["title"] identifier = request.json["identifier"] obj = LO(repository_lo[convert_to_uri(title)]) obj.title = title obj.identifier = identifier return '{"status": "success", "data": {"uri": "' + obj.resUri + '" }, "message": "null" }', 201
def post(self): uri = request.json["uri"] description = request.json["description"] annotations = request.json["annotations"] tags = request.json["tags"] obj = LO("<" + uri + ">") obj.description = description if tags: keywords = [] for value in tags: if value.get("uri") != "undefined": keywords.append(URIRef(value.get("uri"))) else: keywords.append(value.get("label")) # keywords = [URIRef(x.get('uri')) for x in tags] # Armazenando URI como Palavra-chaves obj.subject = keywords # Adicionar os outros metadados. return '{"status": "success", "data": { }, "message": "null" }', 202