If you are running a copy of Wikibase, we have split out data model code from WikibaseLib into a separate extension. (which can be used independent of MediaWiki)
You need to have the WikibaseDataModel extension in the extensions directory. It will automatically be loaded by Wikibase.
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Wikibas...
If you are missing WikibaseDataModel, then you may see an error:
Fatal error: Class 'Wikibase\EntityId' not found
Additionally, the WikibaseQuery, WikibaseQueryEngine and WikibaseDatabase components have been split into separate extensions. These are only needed for the newest experimental query stuff.
https://gerrit.wikimedia.org/r/#/admin/projects/?filter=Wikibase
To make things easier, Wikibase has a composer.json file to manage the dependencies and you can use that, if you like.