entitygraph-client's People
Forkers
bechtleav360entitygraph-client's Issues
Error in Entity.addValue (module 'entitygraph' has no attribute 'client')
Error in version: 0.0.16 (worked with version 0.0.12)
collection_serlo_id = URIRef("https://serlo.org/1535")
entity.addValue(OWL.sameAs, collection_serlo_id)
Error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[9], line 1
----> 1 collection_entity = create_collection_entity(
2 collection_serlo_id, [child_entity_id]
3 )
4 print(collection_entity.json())
5 collection_entity_id = collection_entity.json()[0]["@id"]
Cell In[8], line 8, in create_collection_entity(collection_serlo_id, lr_links)
6 lr_entity_id = lr_link.split('/')[-1]
7 lr_entity = app.Entity().get_by_id(lr_entity_id)
----> 8 collection_entity_builder.addRelation(SDO.hasPart, lr_entity)
10 collection_entity_builder.addValue(OWL.sameAs, collection_serlo_id)
12 collection_entity = collection_entity_builder.build()
File [~/venvs/venv01/lib/python3.10/site-packages/entitygraph/entity_builder.py:33](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/asdf/scripts_e365.notebooks/Working-with-the-entity-graph/maintenance/~/venvs/venv01/lib/python3.10/site-packages/entitygraph/entity_builder.py:33), in EntityBuilder.addRelation(self, property, target_entity)
32 def addRelation(self, property: URIRef, target_entity: Entity):
---> 33 self.graph.add((self.node, property, target_entity.uri))
35 return self
File [~/venvs/venv01/lib/python3.10/site-packages/entitygraph/entity.py:116](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/asdf/scripts_e365.notebooks/Working-with-the-entity-graph/maintenance/~/venvs/venv01/lib/python3.10/site-packages/entitygraph/entity.py:116), in Entity.uri(self)
113 @property
114 def uri(self) -> URIRef:
115 self.__check_id()
--> 116 base_url: str = entitygraph.client.base_url.rstrip("/")
117 return URIRef(f"{base_url}/api/s/{self._application_label}/entities/{self._id}")
AttributeError: module 'entitygraph' has no attribute 'client'
Writing URIs with LinkBuilder.addValue
entitygraph-client version: 0.0.11
In this example, addValue will cast the URIRef to a Literal (entity_builder.py, L.26):
collection_serlo_id = URIRef("https://serlo.org/1535")
child_entity = (
app.EntityBuilder([SDO.Collection])
.addValue(SDO.isPartOf, collection_serlo_id)
).build()
Maybe remove casting in this function or implement a seperate method for this case?
Thanks
Setting mimetype for api calls
self.client: entitygraph.Client = entitygraph.Client(api_key=key)
self.client.entities_api.create(application_label="podcasts", data=adapter.get("content"))
Content in this case is text/turtle
,
AttributeError: 'Client' object has no attribute '_entities_api'
I get the following exception
File "f:\git\scripts_e365.scraper\.venv\Lib\site-packages\entitygraph\client.py", line 40, in entities_api
if self._entities_api is None:
AttributeError: 'Client' object has no attribute '_entities_api'
It is not initialized in the constructor
Feature Request: store content
Please support the following operations
SetValue()
Calls set_value with content_type "text/plain"
Parameters:
- Entity Identifier
- Property (should be qualified URL, so instead of prefixed key "sdo.text" it should be "https://schema.org/text"
- Language (defaults to "en")
- Value (validate, not longer then 255 chars)
- Datatype (optional, defaults to "xsd:string", see https://rdflib.readthedocs.io/en/stable/rdf_terms.html#literals)
- Application (optional)
SetContent()
Calls set_value with content_type "application/octet-stream"
Parameters:
- Entity Identifier
- Property (should be qualified URL, so instead of prefixed key "sdo.text" it should be "https://schema.org/text"
- Language (optional, defaults to "en" for text)
- Content (can be file, path, binary, string)
- Filename (optional, can be random string)
- Application (optional)
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.