{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4801","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4801/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4801/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4801/events","html_url":"https://github.com/orientechnologies/orientdb/issues/4801","id":101194269,"number":4801,"title":"Create class when trying to insert into non-existing class","user":{"login":"chrismichaels84","id":5412413,"avatar_url":"https://avatars.githubusercontent.com/u/5412413?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismichaels84","html_url":"https://github.com/chrismichaels84","followers_url":"https://api.github.com/users/chrismichaels84/followers","following_url":"https://api.github.com/users/chrismichaels84/following{/other_user}","gists_url":"https://api.github.com/users/chrismichaels84/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismichaels84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismichaels84/subscriptions","organizations_url":"https://api.github.com/users/chrismichaels84/orgs","repos_url":"https://api.github.com/users/chrismichaels84/repos","events_url":"https://api.github.com/users/chrismichaels84/events{/privacy}","received_events_url":"https://api.github.com/users/chrismichaels84/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-15T18:07:02Z","updated_at":"2015-08-17T21:44:19Z","closed_at":null,"body":"We are working on a php library that normalizes graph database abstraction and provides a high-level query builder, schema builder, and models. It's called [spider](http://github.com/spider/spider). Right now, there are drivers for Neo4j, Gremlin Server (TP3), and (what my team uses) OrientDB.\r\n\r\nThe have run into an inconsistency between how orient handles creating records and the rest. You can see the discussion at spider/spider#41. \r\n\r\nNeo4j and Gremlin have no concept of Classes (which is one reason we chose Orient), but we have found that the following fails if the class \"person\" does not exist.\r\n\r\n`INSERT INTO person CONTENT {name: 'michael'}`\r\n\r\nIn the others, where we take class to be label, the label is simply created if it doesn't already exist. This seems more graceful to me.\r\n\r\nIs there a workaround that I'm missing, or is this the purposeful behavior? If so, what is the justification?"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/131971217","html_url":"https://github.com/orientechnologies/orientdb/issues/4801#issuecomment-131971217","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4801","id":131971217,"user":{"login":"chrismichaels84","id":5412413,"avatar_url":"https://avatars.githubusercontent.com/u/5412413?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismichaels84","html_url":"https://github.com/chrismichaels84","followers_url":"https://api.github.com/users/chrismichaels84/followers","following_url":"https://api.github.com/users/chrismichaels84/following{/other_user}","gists_url":"https://api.github.com/users/chrismichaels84/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismichaels84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismichaels84/subscriptions","organizations_url":"https://api.github.com/users/chrismichaels84/orgs","repos_url":"https://api.github.com/users/chrismichaels84/repos","events_url":"https://api.github.com/users/chrismichaels84/events{/privacy}","received_events_url":"https://api.github.com/users/chrismichaels84/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T21:44:19Z","updated_at":"2015-08-17T21:44:19Z","body":"My use case may be an edge case, which is why I debated opening the issue at all, but I wanted to see if others had the same situation.\r\n\r\nI am using orient in conjunction with other graph databases, which all have the concept of a label and no real concept of schema beyond that. Even then, a label is just a property that is given some significance in the query (as far as I can tell).\r\n\r\nI am using class as analogous to label. \r\n\r\nIn the others, creating a record *and labeling* it with a label that has not been created throws no exceptions. \r\n\r\nIn orient, creating a record *inside* a class that doesn't exist, I get an exception.\r\n\r\nIs there a better way to normalize this behavior?"}}