Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
stater-tdtopo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengfunan
stater-tdtopo
Commits
3a606bdc
Commit
3a606bdc
authored
Sep 01, 2023
by
zhengfunan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stater版首次提交
parent
94a59521
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
41 deletions
+61
-41
workspace.xml
.idea/workspace.xml
+36
-30
pom.xml
pom.xml
+7
-3
Neo4jAutoConfiguration.java
...n/java/com/tongda/tddopo/auto/Neo4jAutoConfiguration.java
+3
-0
Neo4jServer.java
src/main/java/com/tongda/tddopo/neo4j/Neo4jServer.java
+11
-8
TDGraphService.java
src/main/java/com/tongda/tddopo/service/TDGraphService.java
+4
-0
No files found.
.idea/workspace.xml
View file @
3a606bdc
...
@@ -4,21 +4,12 @@
...
@@ -4,21 +4,12 @@
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
</component>
</component>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"67e936c8-2d55-4655-871e-e6e153e4d8e1"
name=
"更改"
comment=
""
>
<list
default=
"true"
id=
"67e936c8-2d55-4655-871e-e6e153e4d8e1"
name=
"更改"
comment=
"stater版首次提交"
>
<change
afterPath=
"$PROJECT_DIR$/.gitignore"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/.idea/encodings.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/pom.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/pom.xml"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/.idea/misc.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/auto/Neo4jAutoConfiguration.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/auto/Neo4jAutoConfiguration.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/.idea/uiDesigner.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/neo4j/Neo4jServer.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/neo4j/Neo4jServer.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/.idea/vcs.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/service/TDGraphService.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/service/TDGraphService.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/pom.xml"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/auto/Neo4jAutoConfiguration.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/config/Neo4jProperties.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/neo4j/Neo4jServer.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/service/TDGraphService.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/tasks/SynchronizeMetadata.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/java/com/tongda/tddopo/util/GraphUtil.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/resources/META-INF/spring.factories"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
@@ -51,21 +42,21 @@
...
@@ -51,21 +42,21 @@
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"showLibraryContents"
value=
"true"
/>
<option
name=
"showLibraryContents"
value=
"true"
/>
</component>
</component>
<component
name=
"PropertiesComponent"
>
<![CDATA[
{
<component
name=
"PropertiesComponent"
>
{
"keyToString"
: {
"
keyToString
"
: {
"RunOnceActivity.OpenProjectViewOnStart": "true"
,
"
RunOnceActivity.OpenProjectViewOnStart
"
:
"
true
"
,
"RunOnceActivity.ShowReadmeOnStart": "true"
,
"
RunOnceActivity.ShowReadmeOnStart
"
:
"
true
"
,
"SHARE_PROJECT_CONFIGURATION_FILES": "true"
,
"
SHARE_PROJECT_CONFIGURATION_FILES
"
:
"
true
"
,
"WebServerToolWindowFactoryState": "false"
,
"
WebServerToolWindowFactoryState
"
:
"
false
"
,
"last_opened_file_path": "D:/ideawork/stater-tdtopo"
,
"
last_opened_file_path
"
:
"
D:/ideawork/stater-tdtopo
"
,
"node.js.detected.package.eslint": "true"
,
"
node.js.detected.package.eslint
"
:
"
true
"
,
"node.js.detected.package.tslint": "true"
,
"
node.js.detected.package.tslint
"
:
"
true
"
,
"node.js.selected.package.eslint": "(autodetect)"
,
"
node.js.selected.package.eslint
"
:
"
(autodetect)
"
,
"node.js.selected.package.tslint": "(autodetect)"
,
"
node.js.selected.package.tslint
"
:
"
(autodetect)
"
,
"spring.configuration.checksum": "35834eaec7657be6760ebdbe364857eb"
,
"
spring.configuration.checksum
"
:
"
66a313bcaa5305b53f5d76da6e2b169a
"
,
"vue.rearranger.settings.migration": "true"
"
vue.rearranger.settings.migration
"
:
"
true
"
}
}
}
]]>
</component>
}
</component>
<component
name=
"RecentsManager"
>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
<recent
name=
"D:\ideawork\stater-tddopo\src\main\java\com\tongda\tddopo"
/>
<recent
name=
"D:\ideawork\stater-tddopo\src\main\java\com\tongda\tddopo"
/>
...
@@ -106,11 +97,25 @@
...
@@ -106,11 +97,25 @@
<updated>
1693299583537
</updated>
<updated>
1693299583537
</updated>
<workItem
from=
"1693299584659"
duration=
"7284000"
/>
<workItem
from=
"1693299584659"
duration=
"7284000"
/>
<workItem
from=
"1693363826067"
duration=
"10263000"
/>
<workItem
from=
"1693363826067"
duration=
"10263000"
/>
<workItem
from=
"1693386223381"
duration=
"1313000"
/>
<workItem
from=
"1693386223381"
duration=
"3004000"
/>
<workItem
from=
"1693447950473"
duration=
"11267000"
/>
<workItem
from=
"1693536669710"
duration=
"3343000"
/>
</task>
</task>
<task
id=
"LOCAL-00001"
summary=
"stater版首次提交"
>
<created>
1693387558801
</created>
<option
name=
"number"
value=
"00001"
/>
<option
name=
"presentableId"
value=
"LOCAL-00001"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1693387558801
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"2"
/>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"TypeScriptGeneratedFilesManager"
>
<component
name=
"TypeScriptGeneratedFilesManager"
>
<option
name=
"version"
value=
"3"
/>
<option
name=
"version"
value=
"3"
/>
</component>
</component>
<component
name=
"VcsManagerConfiguration"
>
<MESSAGE
value=
"stater版首次提交"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"stater版首次提交"
/>
</component>
</project>
</project>
\ No newline at end of file
pom.xml
View file @
3a606bdc
...
@@ -36,6 +36,13 @@
...
@@ -36,6 +36,13 @@
<version>
3.5.30
</version>
<version>
3.5.30
</version>
</dependency>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.neo4j</groupId>-->
<!-- <artifactId>neo4j-bolt</artifactId>-->
<!-- <!– <version>5.9.0</version>–>-->
<!-- <version>3.5.30</version>-->
<!-- </dependency>-->
<dependency>
<dependency>
<groupId>
org.dom4j
</groupId>
<groupId>
org.dom4j
</groupId>
<artifactId>
dom4j
</artifactId>
<artifactId>
dom4j
</artifactId>
...
@@ -51,6 +58,4 @@
...
@@ -51,6 +58,4 @@
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
src/main/java/com/tongda/tddopo/auto/Neo4jAutoConfiguration.java
View file @
3a606bdc
...
@@ -2,6 +2,7 @@ package com.tongda.tddopo.auto;
...
@@ -2,6 +2,7 @@ package com.tongda.tddopo.auto;
import
com.tongda.tddopo.config.Neo4jProperties
;
import
com.tongda.tddopo.config.Neo4jProperties
;
import
com.tongda.tddopo.neo4j.Neo4jServer
;
import
com.tongda.tddopo.neo4j.Neo4jServer
;
import
com.tongda.tddopo.service.TDGraphService
;
import
org.neo4j.graphdb.GraphDatabaseService
;
import
org.neo4j.graphdb.GraphDatabaseService
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
...
@@ -23,6 +24,8 @@ public class Neo4jAutoConfiguration {
...
@@ -23,6 +24,8 @@ public class Neo4jAutoConfiguration {
//初始化neo4j
//初始化neo4j
GraphDatabaseService
graphDatabaseService
=
new
Neo4jServer
().
init
(
properties
.
getPath
(),
properties
.
getBolt
());
GraphDatabaseService
graphDatabaseService
=
new
Neo4jServer
().
init
(
properties
.
getPath
(),
properties
.
getBolt
());
System
.
out
.
println
(
"neo4j-server启动成功"
);
System
.
out
.
println
(
"neo4j-server启动成功"
);
TDGraphService
tdGraphService
=
new
TDGraphService
();
System
.
out
.
println
(
tdGraphService
.
searchRelationType
());
return
graphDatabaseService
;
return
graphDatabaseService
;
}
}
...
...
src/main/java/com/tongda/tddopo/neo4j/Neo4jServer.java
View file @
3a606bdc
package
com
.
tongda
.
tddopo
.
neo4j
;
package
com
.
tongda
.
tddopo
.
neo4j
;
import
org.neo4j.graphdb.ConstraintViolationException
;
import
org.neo4j.graphdb.GraphDatabaseService
;
import
org.neo4j.graphdb.GraphDatabaseService
;
import
org.neo4j.graphdb.Label
;
import
org.neo4j.graphdb.Label
;
import
org.neo4j.graphdb.Transaction
;
import
org.neo4j.graphdb.Transaction
;
...
@@ -28,7 +29,7 @@ public class Neo4jServer {
...
@@ -28,7 +29,7 @@ public class Neo4jServer {
// @PostConstruct
// @PostConstruct
public
GraphDatabaseService
init
(
String
file
,
String
bolt
){
public
GraphDatabaseService
init
(
String
file
,
String
bolt
){
//
GraphDatabaseSettings.BoltConnector boltConnector = GraphDatabaseSettings.boltConnector( "0" );
GraphDatabaseSettings
.
BoltConnector
boltConnector
=
GraphDatabaseSettings
.
boltConnector
(
"0"
);
graphDatabaseService
=
new
GraphDatabaseFactory
()
graphDatabaseService
=
new
GraphDatabaseFactory
()
.
newEmbeddedDatabaseBuilder
(
new
File
(
file
))
.
newEmbeddedDatabaseBuilder
(
new
File
(
file
))
...
@@ -42,14 +43,16 @@ public class Neo4jServer {
...
@@ -42,14 +43,16 @@ public class Neo4jServer {
IndexDefinition
indexDefinition
;
IndexDefinition
indexDefinition
;
try
(
Transaction
tx
=
graphDatabaseService
.
beginTx
()
)
try
(
Transaction
tx
=
graphDatabaseService
.
beginTx
()
)
{
{
//
Schema schema = graphDatabaseService.schema();
Schema
schema
=
graphDatabaseService
.
schema
();
//
indexDefinition = schema.indexFor( Label.label( "MDE" ))
indexDefinition
=
schema
.
indexFor
(
Label
.
label
(
"MDE"
))
//
.on( "id" )
.
on
(
"id"
)
//
.create();
.
create
();
//
indexDefinition = schema.indexFor( Label.label( "AST" ))
indexDefinition
=
schema
.
indexFor
(
Label
.
label
(
"AST"
))
//
.on( "id" )
.
on
(
"id"
)
//
.create();
.
create
();
tx
.
success
();
tx
.
success
();
}
catch
(
ConstraintViolationException
e
){
System
.
out
.
println
(
"index 已经建立"
);
}
}
return
graphDatabaseService
;
return
graphDatabaseService
;
}
}
...
...
src/main/java/com/tongda/tddopo/service/TDGraphService.java
View file @
3a606bdc
...
@@ -11,11 +11,13 @@ import org.dom4j.DocumentException;
...
@@ -11,11 +11,13 @@ import org.dom4j.DocumentException;
import
org.dom4j.Element
;
import
org.dom4j.Element
;
import
org.dom4j.io.SAXReader
;
import
org.dom4j.io.SAXReader
;
import
org.neo4j.graphdb.*
;
import
org.neo4j.graphdb.*
;
import
org.springframework.stereotype.Service
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
java.util.*
;
@Service
public
class
TDGraphService
{
public
class
TDGraphService
{
GraphDatabaseService
graphDb
=
Neo4jServer
.
graphDatabaseService
;
GraphDatabaseService
graphDb
=
Neo4jServer
.
graphDatabaseService
;
...
@@ -42,6 +44,7 @@ public class TDGraphService {
...
@@ -42,6 +44,7 @@ public class TDGraphService {
long
totalMilliSeconds1
=
System
.
currentTimeMillis
();
long
totalMilliSeconds1
=
System
.
currentTimeMillis
();
try
(
Transaction
transaction
=
graphDb
.
beginTx
())
{
try
(
Transaction
transaction
=
graphDb
.
beginTx
())
{
//解析XML数据
//解析XML数据
SAXReader
saxReader
=
new
SAXReader
();
SAXReader
saxReader
=
new
SAXReader
();
Document
document
=
saxReader
.
read
(
new
ByteArrayInputStream
(
xml
.
getBytes
(
StandardCharsets
.
UTF_8
)));
Document
document
=
saxReader
.
read
(
new
ByteArrayInputStream
(
xml
.
getBytes
(
StandardCharsets
.
UTF_8
)));
...
@@ -232,6 +235,7 @@ public class TDGraphService {
...
@@ -232,6 +235,7 @@ public class TDGraphService {
return
true
;
return
true
;
}
}
/**
/**
* 只更新节点node
* 只更新节点node
* @param xml
* @param xml
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment