Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-julialib
Commits
ddd10f94
Commit
ddd10f94
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Use new datatypes and values in creators
parent
0ee29105
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
ENH: Use new value and datatype structs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Entity.jl
+17
-22
17 additions, 22 deletions
src/Entity.jl
with
17 additions
and
22 deletions
src/Entity.jl
+
17
−
22
View file @
ddd10f94
...
...
@@ -311,22 +311,20 @@ end
"""
function create_property_entity(;
name::AbstractString = "",
datatype::AbstractString = "",
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing,
unit::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
)
Return a new entity object with role Record. If `name`, `datatype`, or
`unit`
were provided, its name, datatype (including whether it
is a
reference or a list), or
unit are set accordingly.
Return a new entity object with role Record. If `name`, `datatype`, or
`unit`
were provided, its name, datatype (including whether it
s `collection` type), or
unit are set accordingly.
"""
function
create_property_entity
(;
name
::
AbstractString
=
""
,
datatype
::
AbstractString
=
""
,
datatype
::
Union
{
AbstractString
,
CaosDB
.
Constants
.
DATATYPE
.
_DATATYPE
}
=
""
,
collection
::
Union
{
CaosDB
.
Constants
.
COLLECTION
.
_COLLECTION
,
Nothing
}
=
nothing
,
unit
::
AbstractString
=
""
,
is_reference
::
Bool
=
false
,
is_list
::
Bool
=
false
,
)
property
=
create_entity
(
name
)
...
...
@@ -334,7 +332,7 @@ function create_property_entity(;
set_role
(
property
,
CaosDB
.
Constants
.
ROLE
.
PROPERTY
)
if
datatype
!=
""
set_datatype
(
property
,
datatype
,
is_list
=
is_list
,
is_reference
=
is_reference
)
set_datatype
(
property
,
datatype
,
collection
)
end
if
unit
!=
""
...
...
@@ -349,16 +347,14 @@ end
name::AbstractString = "",
id::AbstractString = "",
value::Union{AbstractString, Number, Bool} = "",
datatype::AbstractString = "",
is_reference::Bool = false,
is_list::Bool = false,
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing} = nothing,
)
Create a property object that can be appended to another `_Entity`. If
`name`, `id`, or `value` are given, the property's name, id, or value
are set accordingly. The datatype and whether it is a list or a
reference can be specified with `datatype`, `is_reference`, and
`is_list`, respectively.
Create a property object that can be appended to another `_Entity`. If `name`,
`id`, or `value` are given, the property's name, id, or value are set
accordingly. The datatype and its collection type can be specified with
`datatype` and `collection`, respectively.
!!! info
...
...
@@ -369,9 +365,8 @@ function create_property(;
name
::
AbstractString
=
""
,
id
::
AbstractString
=
""
,
value
::
Union
{
AbstractString
,
Number
,
Bool
}
=
""
,
datatype
::
AbstractString
=
""
,
is_reference
::
Bool
=
false
,
is_list
::
Bool
=
false
,
datatype
::
Union
{
AbstractString
,
CaosDB
.
Constants
.
DATATYPE
.
_DATATYPE
}
=
""
,
collection
::
Union
{
CaosDB
.
Constants
.
COLLECTION
.
_COLLECTION
,
Nothing
}
=
nothing
,
)
property
=
Ref
{
_Property
}(
_Property
(
true
))
...
...
@@ -393,7 +388,7 @@ function create_property(;
end
if
datatype
!=
""
set_datatype
(
property
,
datatype
,
is_reference
=
is_reference
,
is_list
=
is_list
)
set_datatype
(
property
,
datatype
,
collection
)
end
if
value
!=
""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment