@@ -20,31 +20,31 @@ Inside the Julia REPL, type ] to enter the Pkg REPL mode then run
2020
2121## Quickstart
2222
23- First make sure, the TypeDB server is running.
23+ First make sure the TypeDB server is running.
2424See [ Start the TypeDB Server] ( https://docs.vaticle.com/docs/running-typedb/install-and-run#start-the-typedb-server ) section.
2525
26- In the Julia REPL or in your source code run :
26+ In the Julia REPL or in your source code:
2727
2828` using TypeDBClient `
2929
3030You have two choices:
3131
32- * If you are only interested in working interactivly , you can use the more simplified API. An example for this is:
32+ * If you are only interested in working interactively , you can use the more simplified API. An example for this is:
3333``` julia
3434using TypeDBClient: dbconnect, open, read, write, match, insert, commit, create_database
3535
3636# Connecting the client to TypeDB
3737dbconnect (" 127.0.0.1" ) do client
3838
39- # Creation of a database
39+ # Create a database
4040 create_database (client, " my-typedb" )
41- # Opening the session
41+ # Opening a session
4242 open (client, " my-typedb" ) do session
4343 # Open a write transaction
4444 write (session) do transaction
45- # Make a insert with a TypeQL string
45+ # Insert a record using TypeQL
4646 insert (transaction, raw " insert $_ isa person;" )
47- # Committing the transaction.
47+ # Commit the transaction
4848 commit (transaction)
4949 end
5050 # Open a read session
@@ -63,28 +63,32 @@ For working with data using TypeQL, please refer to the syntax on [TypeQL Docume
6363``` julia
6464using TypeDBClient
6565
66- # Only for convencience reasons, you can write the full name if you want
66+ # Only for convenience reasons, you can write the full name if you want
6767g = TypeDBClient
6868
6969# Create a client
7070client = g. CoreClient (" 127.0.0.1" ,1729 )
7171
72- # Create a database called typedb if the database isn 't already created by you previously.
72+ # Create a database called typedb if the database wasn 't already created by you previously.
7373g. create_database (client, " typedb" )
7474
75- #= Open a session to write in the schema section of the database.
76- Be careful if you work with a schema session. No more sessions are allowed
77- until you close this session. Closing a session is mandatory. Don't forget this
78- at the end of your work.=#
75+ #=
76+ Open a session to write in the schema section of the database.
77+ Be careful if you work with a schema session. No more sessions are allowed
78+ until you close this session. Closing a session is mandatory. Don't forget this
79+ at the end of your work.
80+ =#
7981session = g. CoreSession (client, " typedb" , g. Proto. Session_Type. SCHEMA, request_timeout= Inf )
8082
8183# Open a write transaction
8284transaction = g. transaction (session, g. Proto. Transaction_Type. WRITE)
8385
84- #= Make a query in the database
85- The result of this query will be a vector of ConceptMap.
86- From there you can access the data as you want.=#
87- results = g. match (transaction, raw """ match $x sub thing;""" )
86+ #=
87+ Make a query in the database
88+ The result of this query will be a vector of ConceptMap.
89+ From there you can access the data as you want.
90+ =#
91+ results = g. match (transaction, " match \$ x sub thing;" )
8892
8993# If you want to work further in the session, go ahead, else close the session.
9094close (session)
@@ -102,36 +106,39 @@ Modules = [TypeDBClient]
102106* delete
103107
104108 There are some delete functions:
109+
105110 * database
106111
107- [ ` delete_database(client::CoreClient, database_name::String ) ` ] ( @ref )
112+ [ ` delete_database(client::AbstractCoreClient, name::AbstractString ) ` ] ( @ref )
108113
109114 * type
110115
111- [ ` delete(r::RemoteConcept{C,T}) where {C <:AbstractThingType, T <: AbstractCoreTransaction} ` ] ( @ref )
116+ [ ` unset_has(transaction::AbstractCoreTransaction, thing::AbstractThing, attribute::Attribute) ` ] ( @ref )
112117
113118 Any type can be deleted with this function. Be aware that only types which have no instances
114119 in the database can be deleted.
115120
116121
117122* get_has
118123
119- [ ` get_owns(r::RemoteConcept{C,T}, value_type::Optional{EnumType}=nothing,keys_only::Bool=false) where {C <: AbstractThingType,T <: AbstractCoreTransaction} ` ] ( @ref )
124+ [ `get_has(transaction::AbstractCoreTransaction,
125+ thing::AbstractThing,
126+ attribute_type::Optional{AttributeType} = nothing,
127+ attribute_types::Optional{Vector{<: AbstractAttributeType }} = nothing,
128+ keys_only = false)`] ( @ref )
120129
121130
122131* get_instances
123132
124- [ `get_instances(r::RemoteConcept{C,T}) where
125- {C <: AbstractThingType,T <: AbstractCoreTransaction}`] ( @ref )
133+ [ ` get_instances(r::RemoteConcept{<:AbstractThingType}) ` ] ( @ref )
126134
127135* get_owns
128136
129137 [ `get_owns(
130- r::RemoteConcept{C,T },
138+ r::RemoteConcept{< : AbstractThingType },
131139 value_type::Optional{EnumType}=nothing,
132140 keys_only::Bool=false
133- ) where {C <: AbstractThingType,T <: AbstractCoreTransaction}`] ( @ref )
134-
141+ )`] ( @ref )
135142
136143* get_owners
137144
@@ -143,25 +150,22 @@ Modules = [TypeDBClient]
143150
144151 * AttributeType
145152
146- [ `get_owners(r::RemoteConcept{C,T}, only_key = false) where {
147- C <: AbstractAttributeType, T <: AbstractCoreTransaction}`] ( @ref )
153+ [ ` get_owners(r::RemoteConcept{<: AbstractAttributeType}, only_key = false) ` ] ( @ref )
148154
149155
150156* get_plays
151157
152- [ `get_plays(r::RemoteConcept{C,T}) where
153- {C <: AbstractThingType,T <: AbstractCoreTransaction}`] ( @ref )
158+ [ ` get_plays(r::RemoteConcept{<: AbstractThingType}) ` ] ( @ref )
154159
155160
156- * get_regex
157161
158- [ `get_regex(r::RemoteConcept{C,T}) where {
159- C <: AbstractAttributeType, T <: AbstractCoreTransaction}`] ( @ref )
162+ * get_regex
160163
164+ [ ` get_regex(r::RemoteConcept{<:AbstractAttributeType}) ` ] ( @ref )
161165
162166* get_rule
163167
164- [ ` get_rule(log_mgr::AbstractLogicManager, label::String ) ` ] ( @ref )
168+ [ ` get_rule(log_mgr::AbstractLogicManager, label::AbstractString ) ` ] ( @ref )
165169
166170
167171* get_rules
@@ -171,65 +175,68 @@ Modules = [TypeDBClient]
171175
172176* get_subtypes
173177
174- [ `get_subtypes(r::RemoteConcept{C,T}) where
175- {C <: AbstractType,T <: AbstractCoreTransaction}` ] ( @ref )
178+ [ ` get_subtypes(r::RemoteConcept{<:AbstractType}) ` ] ( @ref )
179+
176180
177181* get_supertype
178182
179- [ `get_supertype(
180- r::RemoteConcept{C,T}) where {C <: AbstractType,T <: AbstractCoreTransaction}` ] ( @ref )
183+ [ ` get_supertype(r::RemoteConcept{<:AbstractType}) ` ] ( @ref )
184+
181185
182186* get_supertypes
183187
184- [ `get_supertypes(r::RemoteConcept{C,T}) where
185- {C <: AbstractType,T <: AbstractCoreTransaction}` ] ( @ref )
188+ [ ` get_supertypes(r::RemoteConcept{<:AbstractType}) ` ] ( @ref )
189+
186190
187191* set_abstract
188192
189- [ `set_abstract(r::RemoteConcept{C,T}) where
190- {C <: AbstractThingType,T <: AbstractCoreTransaction}`] ( @ref )
193+ [ ` set_abstract(r::RemoteConcept{<:AbstractThingType}) ` ] ( @ref )
191194
192195* set_has
193196
194197 [ ` set_has(transaction::AbstractCoreTransaction, thing::AbstractThing, attribute::Attribute) ` ] ( @ref )
195198
199+
196200* set_label
197201
198- [ `set_label(r::RemoteConcept{C,T}, new_label_name::String) where
199- {C <: AbstractType,T <: AbstractCoreTransaction} `] ( @ref )
202+ [ `set_label(r::RemoteConcept{< : AbstractType },
203+ new_label_name::AbstractString) `] ( @ref )
200204
201205* set_owns
202206
203207 [ `set_owns(
204- r::RemoteConcept{C,T},
205- attribute_type::AbstractType,
206- is_key::Bool=false,
207- overriden_type::Optional{AbstractType}=nothing
208- ) where {C <: AbstractType,T <: AbstractCoreTransaction}`] ( @ref )
208+ r::RemoteConcept{<: AbstractType },
209+ attribute_type::AbstractType,
210+ is_key::Bool=false,
211+ overriden_type::Optional{AbstractType}=nothing
212+ )`] ( @ref )
213+
209214
210215* set_plays
211216
212- [ `function set_plays(
213- r::RemoteConcept{C,T },
217+ [ `set_plays(
218+ r::RemoteConcept{< : AbstractThingType },
214219 role_type::AbstractRoleType,
215220 overridden_role_type::Optional{AbstractRoleType}=nothing
216- ) where {C <: AbstractThingType,T <: AbstractCoreTransaction}`] ( @ref )
221+ )`] ( @ref )
222+
217223
218224* set_regex
219225
220- [ ``set_regex(r::RemoteConcept{C,T}, regex::Optional{AbstractString}) where {
221- C <: AbstractAttributeType, T <: AbstractCoreTransaction}] ( @ref )
226+ [ `set_regex(r::RemoteConcept{<: AbstractAttributeType },
227+ regex::Optional{AbstractString})`] ( @ref )
228+
222229
223230* set_supertype
224231
225- [ `set_supertype(r::RemoteConcept{C,T },
226- super_type::AbstractThingType) where
227- {C <: AbstractThingType,T <: AbstractCoreTransaction}` ] ( @ref )
232+ [ `set_supertype(r::RemoteConcept{<: AbstractThingType,<: AbstractCoreTransaction },
233+ super_type::AbstractThingType)` ] ( @ref )
234+
228235
229236* unset_abstract
230237
231- [ `unset_abstract(r::RemoteConcept{C,T}) where
232- {C <: AbstractThingType,T <: AbstractCoreTransaction}` ] ( @ref )
238+ [ ` unset_abstract(r::RemoteConcept{<:AbstractThingType}) ` ] ( @ref )
239+
233240
234241* unset_has
235242
0 commit comments