Impact 2024: The Industrial Data and AI Conference for and by Users | Nominate Speakers Now for a Ch...
@Diana Chimnaz Johan client: CogniteClient = ...print(f"Max Workers: {client.config.max_workers}") #ensure you have workers >1 :)timeseries = client.time_series.list(limit=None) #not making use of the workerstimeseries = client.time_series.list(partitions=10, limit=None) #will leverage the workers and run in parallel-Jason
@Xiaofeng Wang , unfortunately support was not able to retrieve the logs for your request. We’re working on a process to respond asap to these so we can provide better support.Jason
@Xiaofeng Wang In the end, it was a bit easier to provide an imdb base exampleThis ‘and’ filter get’s all nodes with externalId prefixed with ‘a-emily’ AND in the space imdb. { "includeTyping": false, "instanceType": "node", "filter": { "and": [ { "equals": { "property": [ "node", "space" // [space, externalid, createdTime, lastUpdatedTime] ], "value": "imdb" } }, { "prefix": { "property": [ "node", "externalId" ], // Get me all emily actors "value": "a-emily" } } // { // "equals": { // "property": [ // "node", // "lastUpdatedTime" // [space, externalid, cr
@Sangavi M ,Hello, I’d like to close this. The api is meant to enable you to query nodes which could be part of multiple views so the API response behaved as expected. In your example, if a node instance was part of X86 AND avocet space, you would get results. -Jason
@Xiaofeng Wang, Which project and which model are you wanting to query? I can work to build examples from that.-Jason
@Xiaofeng Wang,Ok, so you’re filtering instances, not views.Please find a working sample. The filter is a dictionary which is the same as the JSON payload which you can find in the API docs. from cognite.client import CogniteClientfrom cognite.client.data_classes.data_modeling.spaces import Space, SpaceListfrom cognite.client.data_classes.data_modeling import ViewList, Viewfrom cognite.client.data_classes.data_modeling import ContainerList, Containerfrom cognite.client.data_classes.data_modeling import DataModelList, DataModelfrom cognite.client.data_classes.data_modeling import NodeList, Node, EdgeList, Edgeclient: CogniteClient = .... # Get your client your way# The filter is a dictionaryemily_actors = { "and": [ { "equals": { "property": [ "node", "space" ], "value": "imdb" } }, { "prefix": {
@Xiaofeng Wang,ViewId type does not have a property externalId, but does have a property ‘external_id’ 😀Are you trying to filter views based on external_id? If so, I’m a bit confused, because retrieving views by id explicitly will only retrieve one.What type is the ‘filters’ object you have above?-Jason
@Xiaofeng Wang Thank you for sharing this. I have reported. I will get back to you with any updates 😀-Jason
@Peter Quinn ,Try adding id to the select clause. id is an auto generated, internal identifier. Yes, as you highlight, it’s good practice to specify an externalId. externalId must be unique per CDF resource type.-Jason
@Lucas Carvalho de Sousa Glad to help!autoCreateStart|End will help if you created edges before the nodes exist. This will auto create missing nodes for you. You’d still need to populate those nodes with properties, but those nodes would pre-exist with the externalIds you specified during edge creation.-Jason
@Xiaofeng Wang Yes, this does seem to be a ‘feature’ of the UI. Please feel free to log as a bug in zendesk. Please note that there are UX changes coming with respect to visualizing your data in data modelling. -Jason
@Xiaofeng Wang ,Yes, I would typically create Nodes first. Any direct relations to other nodes can be parameterized to be auto created for you so that when you create those nodes, you should have consistency. Then I create edges. For me, this generally makes the most sense. We can have a quick call to review your use case if you’d like.-Jason
@Lucas Carvalho de Sousa ,Ok, I get your point 😀.Given the following model and using Movie as the example:type PersonType @view(space: "imdb", version: "1") { typename: String! people: [Person] @relation(type:{space:"imdb", externalId: "Person.people"}, direction: INWARDS)}interface Person @view(space: "imdb", version: "1") { personType: PersonType name: String! age: Int}type Actor implements Person @view(space: "imdb", version: "1") { personType: PersonType name: String! age: Int wonOscar: Boolean hasDirected: Boolean movies: [Movie] @relation(type:{space:"imdb", externalId: "Movie.actors"}, direction: INWARDS)}type Director implements Person @view(space: "imdb", version: "1") { personType: PersonType name: String! age: Int wonOscar: Boolean directed: [Movie] @relation(type:{space:"imdb", externalId: "Movie.director"}, direction: INWARDS)}type Movie @view(space: "imdb", version: "1") { name: String! description: String watchedI
@Lucas Carvalho de Sousa,Can you kindly share the model you are working to create instances for please 😀 and the full POST request?I believe that supportingCast is of type [Actor]. I believe in the above, you are creating ‘"instanceType": "node"’. With nodes, you can create direct relationships at the same time (lead), but to create the supportingCast, you need to create "instanceType": "edge" in a separate REST call. -Jason
@Shreyas Mehta I do not see why not…. so Yes you can. The Relationship type is just a ‘View’ that has a direct relation to a RelationshipType type. All I see is the @edge directive, sets the ‘usedFor” property of a View to be ‘edge’ vs ‘node’-Jason
@eashwar11, You can specific via the SDK to recursively delete your asset tree: https://cognite-sdk-python.readthedocs-hosted.com/en/latest/core_data_model.html#delete-assetsclient.assets.delete(id=[3043982824375333], recursive=True)-Jason
@Shreyas Mehta I’m told to combine the @edge and @view directives like the following. This will work for you. type ActedIn @edge @view(space: "imdb", version: "1"){roleCode: Stringsalary: Float}
@Mohammad Imran,Cognite Data Fusion (CDF) is a micro-services architecture SaaS application that is deployed to 3 major cloud service providers today (Azure, Google and most recently AWS). CDF consists of 300+ micro-services which are continuously deployed as many as 1000 times per week across development, staging and production environments. The infrastructure is predominantly Kubernetes based. Storage consists of a polyglot system of technologies based on data type, availability, scalability and performance requirements. Storing and serving time series data, for instance, involves a combination of storage technologies (Foundation db, Kafka, PostgreSQL, Elastic Search). You can read more about availability, business continuity, backups here at the following link: https://docs.cognite.com/cdf/trust/security/availability_continuityHope this helps,-Jason
@Lihui Meng,Today, getting a list of pages or navigating by offset is not supported. This was a conscious decision. In short, records may change (added or deleted) by other users or processes while any given user is navigating the records. Navigating to a particular offset may return different records each time the request is made. A similar request was asked: -Jason
@carriechung,Regarding model structure changes: https://developer.cognite.com/dm/graphql/modeling#versioningIn short, every structure change to your Type will be a new version. In regards to versioning best practices it’s important to understand that a data model is a versioned collection of versioned views. You can see this when you query the data models endpoint: GET /models/datamodels. This returns a response like the following:The model is versioned and each view (type) of that model are versioned. You explicitly control the version of the model and views. A discussion can be found here: https://docs.cognite.com/cdf/data_modeling/guides/manage_dmVersioning can be done in multiple ways. If you are using the Fusion user interface, you can specify the version of the model when you publish and explicitly version each view using the @view directive. If you are publishing your models via the API, then you set the version in the API request.{ "items": [ { "space
@Xiaofeng Wang Are you listing/querying or creating instances? Can you kindly share an representative example?-Jason
@Shreyas Mehta ,Yes will create a feature request. Please ensure this request is on slb ADO board as well for tracking :).-Jason
@Adrian Dams ,If your data has been ingested as Assets of a particular Dataset, you use those as your source. You can then map from Asset attributes and metadata to populate your target data model.-Jason
@Mohammad Imran,Getting a list of cursors is not currently supported. So, yes, you’d need to go forward and cache each in order to back.-Jason
@Mohit ShakalymyType is a directRelation. It’s type is defined by a (space, externalId) tuple. Apologies for the very delayed reply. I’m using the null of the externalId as a measure of ‘null’ with respect to the direct relation.# Based on the following model derived from the Actor/Movie example:type PersonType @view(space: "test", version: "1") { typename: String!}interface Person @view(space: "test", version: "1") { typename: PersonType name: String! age: Int}#populate your Actors with 'actor' as the PersonType, do not populate the Directors with any typename# using the following graphQL query, you'll get just 'Director' Personsquery MyQuery { listPerson(filter: {typename: {externalId: {isNull: true}}}) { items { name typename { typename } } }} fyi @Dilini Fernando
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.