You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "insist93 (via GitHub)" <gi...@apache.org> on 2024/10/16 02:19:03 UTC
[I] [Question] 创建图的时候,支持同时增加关元数据吗? [incubator-hugegraph]
insist93 opened a new issue, #2679:
URL: https://github.com/apache/incubator-hugegraph/issues/2679
### Problem Type (问题类型)
others (please edit later)
### Before submit
- [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
### Environment (环境信息)
- Server Version: docker images:hugegraph/hugegraph 1.3.0
### Your Question (问题描述)
# 有没有什么方法,创建图的时候同事插入图的元素据
### Vertex/Edge example (问题点 / 边数据举例)
_No response_
### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Question] 创建图的时候,支持同时增加元数据吗? [incubator-hugegraph]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #2679:
URL: https://github.com/apache/incubator-hugegraph/issues/2679#issuecomment-2452588091
Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] [Question] 创建图的时候,支持同时增加元数据吗? [incubator-hugegraph]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #2679:
URL: https://github.com/apache/incubator-hugegraph/issues/2679#issuecomment-2418641342
<!-- Answer -->
HugeGraph provides an API for managing graph-level metadata separate from vertex and edge properties. The `MetaManager` class includes managers like `GraphMetaManager`, which can handle graph-level metadata operations. However, specific methods for setting custom metadata attributes like `graph_create_time` and `graph_owner` are not explicitly documented. You might need to explore the `MetaManager` class further or consider using custom solutions to manage such metadata <sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/MetaManager.java)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] [Question] 创建图的时候,支持同时增加元数据吗? [incubator-hugegraph]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #2679:
URL: https://github.com/apache/incubator-hugegraph/issues/2679#issuecomment-2416160263
<!-- Answer -->
To create HugeGraph graph schema metadata such as `VertexLabel` and `EdgeLabel` using Gremlin syntax, you can use the following examples:
**Creating VertexLabel:**
```groovy
person = graph.schema().vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
software = graph.schema().vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
```
**Creating EdgeLabel:**
```groovy
knows = graph.schema().edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date").ifNotExist().create()
created = graph.schema().edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "city").ifNotExist().create()
```
These examples demonstrate how to define vertex and edge labels with associated properties and primary keys using Gremlin syntax in HugeGraph. Additionally, you can create property keys before defining vertex and edge labels:
**Creating PropertyKey:**
```groovy
graph.schema().propertyKey("name").asText().ifNotExist().create()
graph.schema().propertyKey("age").asInt().ifNotExist().create()
graph.schema().propertyKey("city").asText().ifNotExist().create()
graph.schema().propertyKey("lang").asText().ifNotExist().create()
graph.schema().propertyKey("date").asText().ifNotExist().create()
graph.schema().propertyKey("price").asInt().ifNotExist().create()
```
These property keys are then used in the vertex and edge label definitions <sup>[[1]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/en/docs/quickstart/hugegraph-studio.md)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/cn/docs/quickstart/hugegraph-studio.md)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] [Question] 创建图的时候,支持同时增加元数据吗? [incubator-hugegraph]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #2679: [Question] 创建图的时候,支持同时增加元数据吗?
URL: https://github.com/apache/incubator-hugegraph/issues/2679
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Question] 创建图的时候,支持同时增加元数据吗? [incubator-hugegraph]
Posted by "insist93 (via GitHub)" <gi...@apache.org>.
insist93 commented on issue #2679:
URL: https://github.com/apache/incubator-hugegraph/issues/2679#issuecomment-2418638835
> @insist93 Yes, `Gremlin` supports the Groovy syntax when querying, allowing for the execution of multiple statements at once, including metadata CRUD, graph data CURD, and graph queries, making it versatile (use `;` to separate one line)
>
> @dosu Can you give some examples of the meta-data (`VertexLabel/EdgeLable`) that created the HugeGraph graph schema in Gremlin, so that they can execute it at one time
The meta data I mentioned above refers to meta attributes like graph_create_time, graph_owner, etc., not vertices and edges propertiyes;is there any other api?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] [Question] 创建图的时候,支持同时增加关元数据吗? [incubator-hugegraph]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #2679:
URL: https://github.com/apache/incubator-hugegraph/issues/2679#issuecomment-2415589696
<!-- Greeting -->
Hello, @insist93! I'm here to help you with any bugs, questions, or contributions you might have for the project. Let's work together to solve the issue you're facing.
<!-- Answer -->
是的,HugeGraph 提供了一个名为 "HugeGraph-Loader" 的工具,可以在创建图的同时插入数据。HugeGraph-Loader 是基于 HugeGraph-Client 的数据导入工具,它可以将普通文本数据转换为图的顶点和边,并将其插入到图数据库中 <sup>[[1]](https://github.com/apache/incubator-hugegraph-doc/blob/master/README.md)</sup>。
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] [Question] 创建图的时候,支持同时增加元数据吗? [incubator-hugegraph]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on issue #2679:
URL: https://github.com/apache/incubator-hugegraph/issues/2679#issuecomment-2416156602
@insist93
Yes, `Gremlin` supports the Groovy syntax when querying, allowing for the execution of multiple statements at once, including metadata CRUD, graph data CURD, and graph queries, making it versatile
@dosu Can you give some examples of the meta-data (`VertexLabel/EdgeLable`) that created the HugeGraph graph schema in Gremlin, so that they can execute it at one time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org