Compare commits
5 Commits
0d18fddab6
...
133bd69291
| Author | SHA1 | Date | |
|---|---|---|---|
| 133bd69291 | |||
| 830c514fa6 | |||
| e76e213e9d | |||
| f570ce7a30 | |||
| 14964df730 |
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="Encoding">
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/relation-completion/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@
|
||||||
<option name="originalFiles">
|
<option name="originalFiles">
|
||||||
<list>
|
<list>
|
||||||
<option value="$PROJECT_DIR$/pom.xml" />
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/relation-completion/pom.xml" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1 +1,5 @@
|
||||||
用于存放工具代码,每一个工具都新建一个分支操作
|
用于将nebula种的关系进行反向补全
|
||||||
|
存在
|
||||||
|
A--follow-->B
|
||||||
|
补全
|
||||||
|
B--follower-->A
|
||||||
37
complete-relation/pom.xml
Normal file
37
complete-relation/pom.xml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.idata</groupId>
|
||||||
|
<artifactId>y-server-tools</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<groupId>com.idata.tools</groupId>
|
||||||
|
<artifactId>complete-relation</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.36</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.opencsv</groupId>
|
||||||
|
<artifactId>opencsv</artifactId>
|
||||||
|
<version>5.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.idata.tools.relation.completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: ChenYawei
|
||||||
|
* @date: 2025/1/15 16:29
|
||||||
|
*/
|
||||||
|
public class RelationCompletion {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.idata.tools.relation.contants;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import static com.idata.tools.relation.contants.NetworkConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: ChenYawei
|
||||||
|
* @date: 2025/1/7 14:14
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum EdgeEnums {
|
||||||
|
// A关注B, B的粉丝是A
|
||||||
|
EDGE_FOLLOW_(EDGE_FOLLOW, TAG_USER, TAG_USER, EDGE_FOLLOWER),
|
||||||
|
|
||||||
|
// A->B A的粉丝是B, B关注A
|
||||||
|
EDGE_FOLLOWER_(EDGE_FOLLOWER, TAG_USER, TAG_USER, EDGE_FOLLOW),
|
||||||
|
|
||||||
|
// 群体个体包含关系——个体群体属于关系
|
||||||
|
EDGE_GROUP_INCLUDE_USER_(EDGE_GROUP_INCLUDE_USER, TAG_GROUP, TAG_USER, EDGE_USER_JOIN_GROUP),
|
||||||
|
|
||||||
|
// 个体群体属于关系——群体个体包含关系
|
||||||
|
EDGE_USER_JOIN_GROUP_(EDGE_USER_JOIN_GROUP, TAG_USER, TAG_GROUP, EDGE_GROUP_INCLUDE_USER),
|
||||||
|
|
||||||
|
// 组织个体包含关系——个体组织属于关系
|
||||||
|
EDGE_ORGANIZATION(EDGE_ORGANIZATION_INCLUDE_USER, TAG_ORGANIZATION, TAG_USER, EDGE_USER_JOIN_ORGANIZATION),
|
||||||
|
|
||||||
|
// 个体组织属于关系——组织个体包含关系
|
||||||
|
USER_JOIN_ORGANIZATION(EDGE_USER_JOIN_ORGANIZATION, TAG_USER, TAG_ORGANIZATION, EDGE_ORGANIZATION_INCLUDE_USER),
|
||||||
|
|
||||||
|
// 事件个体包含关系——个体事件参与关系
|
||||||
|
TASK_INCLUDE_USER(EDGE_TASK_INCLUDE_USER, TAG_TASK, TAG_USER, EDGE_USER_PARTICIPATE_TASK),
|
||||||
|
|
||||||
|
// 个体事件参与关系——事件个体包含关系
|
||||||
|
USER_PARTICIPATE_TASK(EDGE_USER_PARTICIPATE_TASK, TAG_USER, TAG_USER, EDGE_TASK_INCLUDE_USER),
|
||||||
|
|
||||||
|
// 事件帖文包含关系——帖文事件属于关系
|
||||||
|
TASK_INCLUDE_POST(EDGE_TASK_INCLUDE_POST, TAG_TASK, TAG_POST, EDGE_POST_IN_TASK),
|
||||||
|
|
||||||
|
// 帖文事件属于关系——事件帖文包含关系
|
||||||
|
POST_IN_TASK(EDGE_POST_IN_TASK, TAG_POST, TAG_TASK, EDGE_TASK_INCLUDE_POST),
|
||||||
|
;
|
||||||
|
|
||||||
|
private String edgeType;
|
||||||
|
private String srcTag;
|
||||||
|
private String dstTag;
|
||||||
|
private String reverseRelation;
|
||||||
|
|
||||||
|
EdgeEnums(String edgeType, String srcTag, String dstTag, String reverseRelation) {
|
||||||
|
this.edgeType = edgeType;
|
||||||
|
this.srcTag = srcTag;
|
||||||
|
this.dstTag = dstTag;
|
||||||
|
this.reverseRelation = reverseRelation;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.idata.tools.relation.contants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author:ChenYawei
|
||||||
|
* @Date:2024/8/14 9:51
|
||||||
|
*/
|
||||||
|
public class NetworkConstants {
|
||||||
|
|
||||||
|
// 关系类型
|
||||||
|
// a的好友是b
|
||||||
|
public static final String EDGE_FRIENDS = "user_friend_user";
|
||||||
|
// a关注b
|
||||||
|
public static final String EDGE_FOLLOW = "user_follow_user";
|
||||||
|
// a的粉丝是b
|
||||||
|
public static final String EDGE_FOLLOWER = "user_follower_user";
|
||||||
|
// 个体评论个体
|
||||||
|
public static final String EDGE_USER_COMMENT_USER = "user_comment_user";
|
||||||
|
// 个体属于组织
|
||||||
|
public static final String USER_JOIN_ORGANIZATION = "user_join_organization";
|
||||||
|
// 个体发帖
|
||||||
|
public static final String EDGE_USER_POST_POST = "user_post_post";
|
||||||
|
|
||||||
|
|
||||||
|
// 帖文评论帖文
|
||||||
|
public static final String EDGE_POST_COMMENT_POST = "post_comment_post";
|
||||||
|
// 个体相关的帖文,包括原发、转发、评论等
|
||||||
|
public static final String EDGE_USER_HAVE_POST = "user_have_post";
|
||||||
|
// 帖文引用帖文
|
||||||
|
public static final String EDGE_POST_CITE_POST = "post_cite_post";
|
||||||
|
// 帖文转发帖文
|
||||||
|
public static final String EDGE_POST_FORWARD_POST = "post_repost_post";
|
||||||
|
// 帖文多级评论
|
||||||
|
public static final String EDGE_POST_MULTICOMMENT_POST = "post_multicomment_post";
|
||||||
|
|
||||||
|
// 群组包含个体
|
||||||
|
public static final String EDGE_GROUP_INCLUDE_USER = "group_include_user";
|
||||||
|
// 个体属于群组
|
||||||
|
public static final String EDGE_USER_JOIN_GROUP = "user_join_group";
|
||||||
|
|
||||||
|
|
||||||
|
// 个体参与事件
|
||||||
|
public static final String EDGE_USER_PARTICIPATE_TASK = "user_participate_task";
|
||||||
|
// 事件包含个体
|
||||||
|
public static final String EDGE_TASK_INCLUDE_USER = "task_include_user";
|
||||||
|
// 帖文属于事件
|
||||||
|
public static final String EDGE_POST_IN_TASK = "post_in_task";
|
||||||
|
// 事件中包含帖文
|
||||||
|
public static final String EDGE_TASK_INCLUDE_POST = "task_include_post";
|
||||||
|
|
||||||
|
// 组织包含个体
|
||||||
|
public static final String EDGE_ORGANIZATION_INCLUDE_USER = "organization_include_user";
|
||||||
|
// 个体属于组织
|
||||||
|
public static final String EDGE_USER_JOIN_ORGANIZATION = "user_join_organization";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 节点类型
|
||||||
|
// 个体
|
||||||
|
public static final String TAG_USER = "user";
|
||||||
|
// 帖文
|
||||||
|
public static final String TAG_POST = "post";
|
||||||
|
// 群体
|
||||||
|
public static final String TAG_GROUP = "group";
|
||||||
|
// 组织
|
||||||
|
public static final String TAG_ORGANIZATION = "organization";
|
||||||
|
// 事件
|
||||||
|
public static final String TAG_TASK = "task";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 节点的属性字段
|
||||||
|
// 节点的平台属性
|
||||||
|
public static final String PLATFORM = "platform";
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.idata.tools.relation.contants;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import static com.idata.tools.relation.contants.NetworkConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: ChenYawei
|
||||||
|
* @date: 2025/1/15 15:13
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum Tag {
|
||||||
|
|
||||||
|
USER(TAG_USER),
|
||||||
|
GROUP(TAG_GROUP),
|
||||||
|
ORGANIZATION(TAG_ORGANIZATION),
|
||||||
|
TASK(TAG_TASK),
|
||||||
|
;
|
||||||
|
|
||||||
|
private String tag;
|
||||||
|
|
||||||
|
Tag(String tag) {
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
4
pom.xml
4
pom.xml
|
|
@ -7,6 +7,10 @@
|
||||||
<groupId>com.idata</groupId>
|
<groupId>com.idata</groupId>
|
||||||
<artifactId>y-server-tools</artifactId>
|
<artifactId>y-server-tools</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>complete-relation</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user