Skip to content
Snippets Groups Projects
Commit 50cf9d24 authored by florian's avatar florian
Browse files

ENH: Add `is_list` and `is_reference` to property creators

parent eb57ac6c
Branches
No related tags found
1 merge request!7ENH: Implement queries and entity retrieval
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
...@@ -254,12 +254,15 @@ end ...@@ -254,12 +254,15 @@ end
) )
Return a new entity object with role Record. If `name`, `datatype`, or Return a new entity object with role Record. If `name`, `datatype`, or
`unit` were provided, its name, datatype, or unit are set accordingly. `unit` were provided, its name, datatype (including whether it is a
reference or a list), or unit are set accordingly.
""" """
function create_property_entity(; function create_property_entity(;
name::AbstractString = "", name::AbstractString = "",
datatype::AbstractString = "", datatype::AbstractString = "",
unit::AbstractString = "", unit::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
) )
property = create_entity(name) property = create_entity(name)
...@@ -267,7 +270,7 @@ function create_property_entity(; ...@@ -267,7 +270,7 @@ function create_property_entity(;
set_role(property, "PROPERTY") set_role(property, "PROPERTY")
if datatype != "" if datatype != ""
set_datatype(property, datatype) set_datatype(property, datatype, is_list = is_list, is_reference = is_reference)
end end
if unit != "" if unit != ""
...@@ -297,6 +300,9 @@ function create_property(; ...@@ -297,6 +300,9 @@ function create_property(;
name::AbstractString = "", name::AbstractString = "",
id::AbstractString = "", id::AbstractString = "",
value::AbstractString = "", value::AbstractString = "",
datatype::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
) )
property = Ref{_Property}(_Property(true)) property = Ref{_Property}(_Property(true))
...@@ -317,6 +323,10 @@ function create_property(; ...@@ -317,6 +323,10 @@ function create_property(;
set_id(property, id) set_id(property, id)
end end
if datatype != ""
set_datatype(property, datatype, is_reference = is_reference, is_list = is_list)
end
if value != "" if value != ""
set_value(property, value) set_value(property, value)
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment