Comments (13)
The version you are using is extremely outdated, so the url of the repository has changed.
The artifact should still available at https://repo.vaticle.com/repository/maven/
I also see you're using TypeDB 2.21? If so, you should be using the TypeDB client:
https://typedb.com/docs/clients/2.x/java/java-install
The modern equivalent of Grami is TypeDB loader: https://github.com/typedb-osi/typedb-loader
from typedb.
Closing this. Please, re-open if needed.
from typedb.
This still doesn't resolve my issue.
I am running typedb server in dcoker container.
2023-10-03 21:41:07 01:41:07.804 [main] INFO com.vaticle.typedb.core.server.TypeDBServer - version: 2.21.1
maven pom.xml
`
<repositories>
<repository>
<id>repo.vaticle.com</id>
<url>https://repo.vaticle.com/repository/maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.vaticle.typedb</groupId>
<artifactId>typedb-client</artifactId>
<version>2.18.0</version>
</dependency>
</dependencies>
`
java code:
`
package org.example;
import cli.LoadOptions;
import loader.TypeDBLoader;
public class LoadingData {
public void loadData() {
String uri = "localhost:1729";
String config = "dataConfig.json";
String database = "databaseName";
String[] args = {
"load",
"-tdb", uri,
"-c", config,
"-db", database,
"-cm"
};
LoadOptions options = LoadOptions.parse(args);
TypeDBLoader loader = new TypeDBLoader(options);
loader.load();
}
}
`
Not able to resolve the LoadOptions and TypeDBLoader objects in this java code.
from typedb.
Ensure that the osi-maven repository is also added:
<repository>
<id>typedb</id>
<url>https://repo.vaticle.com/repository/osi-maven/</url>
</repository>
and that you've declared the loader dependency:
<dependency>
<groupId>com.vaticle.typedb-osi</groupId>
<artifactId>typedb-loader</artifactId>
<version>1.2.0</version>
</dependency>
See the full instructions: https://github.com/typedb-osi/typedb-loader/wiki/09-TypeDB-Loader-as-Dependency
from typedb.
I used same pom.xml as described in the instructions provided by you;
"""
typedb
https://repo.vaticle.com/repository/maven/
typedb
https://repo.vaticle.com/repository/osi-maven/
jitpack.io
https://jitpack.io
<dependencies>
<dependency>
<groupId>com.vaticle.typedb-osi</groupId>
<artifactId>typedb-loader</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
"""
Still the same issue.
from typedb.
From your code:
package org.example;
import cli.LoadOptions;
import loader.TypeDBLoader;
I think these import paths are not specific enough. Can you try importing these by a full-er path, i.e. com.vaticle.typedb.osi.loader.cli.LoadOptions
? Likewise for the Loader itself, something like com.vaticle.typedb.osi.loader.loader.TypeDBLoader
.
from typedb.
pom.xml
`
<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>
<groupId>org.example</groupId>
<artifactId>datamigration</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>repo.vaticle.com</id>
<url>https://repo.vaticle.com/repository/maven/</url>
</repository>
<repository>
<id>typedb</id>
<url>https://repo.vaticle.com/repository/osi-maven/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.vaticle.typedb</groupId>
<artifactId>typedb-client</artifactId>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>com.vaticle.typedb-osi</groupId>
<artifactId>typedb-loader</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</project>
`
Java code:
`package org.example;
import com.vaticle.typedb.osi.loader.cli.LoadOptions;
import com.vaticle.typedb.osi.loader.loader.TypeDBLoader;
public class LoadingData {
public void loadData() {
String uri = "localhost:1729";
String config = "dataConfig.json";
String database = "databaseName";
String[] args = {
"load",
"-tdb", uri,
"-c", config,
"-db", database,
"-cm"
};
LoadOptions options = LoadOptions.parse(args);
TypeDBLoader loader = new TypeDBLoader(options);
loader.load();
}
}
`
Error
Cannot resolve symbol 'osi'
Cannot resolve symbol 'LoadOptions'
Cannot resolve symbol 'TypeDBLoader'
from typedb.
krishnangovindraj This issue isn't resolved, can you please help ?
from typedb.
@krish-yadav23 Could you try version 1.7.0
for typebd-loader please?
That seems to work for me.
from typedb.
Thank you krishnangovindraj , i was able to proceed. However, i am now facing below issue while dumping data from csv file.
Inside Loading data11:37:20.488 [main] INFO com.vaticle.typedb.osi.loader.loader - validating your config... Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.vaticle.typedb.osi.loader.config.Configuration$GlobalConfig.getSchema()" because the return value of "com.vaticle.typedb.osi.loader.config.Configuration.getGlobalConfig()" is null at com.vaticle.typedb.osi.loader.config.ConfigurationValidation.validateSchemaPresent(ConfigurationValidation.java:287) at com.vaticle.typedb.osi.loader.loader.TypeDBLoader.load(TypeDBLoader.java:52) at org.example.LoadingData.loadData(LoadingData.java:21) at org.example.Main.main(Main.java:9)
`
My Config file
{
"Instructor": {
"dataPath": "D:\TypedbWorkspace\dataFiles\entity_example.csv",
"separator": ",",
"processor": "Instructor",
"batchSize": 2000,
"threads": 4,
"attributes": [
{
"columnName": "id",
"generator": "id"
},
{
"columnName": "email",
"generator" : "email"
},
{
"columnName": "firstname",
"generator": "firstname"
},
{
"columnName": "lastname",
"generator": "lastname"
}]
}
}
`
from typedb.
I think the config file structure may have changed to include the schema.
Please refer to the wiki for typedb-loader: https://github.com/typedb-osi/typedb-loader/wiki/01-Global-Configuration
from typedb.
Okay, i tried that and now facing issue saying file not found.
{
"globalConfig":{
"separator":",",
"rowsPerCommit":50,
"parallelisation":4,
"schema":"src/test/resources/eduSchema.gql"
},
"entities":{
"Instructor":{
"data":[
"src/test/resources/entity_instructor.csv",
],
"config":{
"separator":",",
"rowsPerCommit":50
},
"insert":{
"entity":"Instructor",
"ownerships":[
{
"attribute":"id",
"generator":"id",
"required":false
},
{
"attribute":"email",
"generator":"email",
"required":false
},
{
"attribute":"firstname",
"generator":"firstname",
"required":false
},
{
"attribute":"lastname",
"generator":"lastname",
"required":false
}
]
}
}
}
}
Config file set in java code:
String config = "D:\Typedb Workspace\dataConfig.json";
Error:
14:30:36.835 [main] INFO com.vaticle.typedb.osi.loader.loader - validating your config...
14:30:37.276 [main] WARN com.vaticle.typedb.osi.loader.loader - defaultConfig.parallelisation is not set - defaults to number of processors on machine * 8
14:30:37.276 [main] ERROR com.vaticle.typedb.osi.loader.loader - entities.Instructor.data: <null>: file not found
Files are already present on my windows machine in src/test/resources/
Is this how it expects file paths? can't we give absolute paths if relative paths are not working?
from typedb.
I was able to dump data in typedb after making changes to the config file.
{
"globalConfig":{
"separator":",",
"rowsPerCommit":50,
"parallelisation":4,
"schema":"src/test/resources/eduSchema.gql"
},
"entities":{
"Instructor":{
"data":[
"src/test/resources/entity_instructor.csv"
],
"config":{
"separator":",",
"rowsPerCommit":50
},
"insert":{
"entity":"Instructor",
"ownerships":[
{
"attribute":"id",
"column":"id",
"required":false
},
{
"attribute":"email",
"column":"email",
"required":false
},
{
"attribute":"firstname",
"column":"firstname",
"required":false
},
{
"attribute":"lastname",
"column":"lastname",
"required":false
}
]
}
}
}
}
Thank you krishnangovindraj, jamesreprise for your help.
from typedb.
Related Issues (20)
- Allow parallelised read Concept API requests HOT 1
- Update query can leave dangling role edges
- Can't get the number of an unknown enum value HOT 2
- Node driver issues updating from node-client HOT 1
- Validate system resources on bootup to avoid corrupt storage column family HOT 1
- TypeQL fetch attribute type response needs value type
- Make TypeDB Core, Enterprise, and Console naming consistent
- [Feature request] Shared vs scoped/contextualized rules HOT 2
- [Feature request] OnWrite / OnRead hooks
- Typedb 3.0 wishlist HOT 5
- Fetch query fails to parse special character whereas equivalent Get query can
- Attribute fetch should trigger reasoning
- An error message for providing a value of a wrong type is not specific enough
- Duplicate insertions HOT 3
- Unique and key constraints blocks certain valid writes
- Exception in thread `main` `java.lang.NullPointerException`: Cannot invoke `java.net.NetworkInterface.getHardwareAddress()` because the return value of `java.net.NetworkInterface.getByInetAddress(java.net.InetAddress)` is null HOT 9
- Package repository migration breaks debian installation via apt
- Using `RelationType.set_relates` can corrupt the schema
- Fix difficult TypeQL expressions HOT 18
- [Feature request] Data virtualzation with TypeDB HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typedb.