Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ graph LR

plan-yaml-ld-to-pyld("Start moving stuff:<br/>Python <code>yaml-ld</code> → <code>pyld</code>") --> happiness

shacl("Choose facets<br/>based on SHACL shapes") --> happiness
publish-with-mkdocs("Publish LD<br/>@ <code>mkdocs-iolanta</code>") --> happiness

tex("Embed an Iolanta visualization into a LaTeX document") --> happiness
tractatus("Tractatus Logico-Philosophicus → LD") --> happiness

starts-from-console("Iolanta starts with a blank console") --> happiness
class starts-from-console bug

subgraph "YAML-LD nanopublication on the front page"
direction LR
nanopublication-is-not-satisfactory("Nanopublication on front page<br/>is not satisfactory")
Expand All @@ -35,8 +44,9 @@ graph LR
click literal-clickable "https://github.com/iolanta-tech/iolanta/issues/260"
class literal-clickable bug

fip-term-messy("<strong>Knowledge representation language</strong><br/>display is messy") --> nanopublication-is-not-satisfactory
fip-term-messy("<strong>Knowledge representation language</strong><br/>not displayed as a Nanopub") --> fip-term-instances("<strong>Knowledge Representation Language</strong><br/>does not show all its instances") --> nanopublication-is-not-satisfactory
class fip-term-messy bug
class fip-term-instances bug

spec("YAML-LD spec is a URL<br/>not title") --> nanopublication-is-not-satisfactory
class spec bug
Expand Down Expand Up @@ -72,6 +82,7 @@ graph LR

python-yaml-ld-markdown-ld("➕ Markdown-LD parser<br/>@ <code>python-yaml-ld</code>") --> markdown-ld("Edit a Markdown-LD document") --> markdown-nanopub-blog-post
click markdown-ld "https://github.com/iolanta-tech/iolanta/issues/261"
markdown-ld --> happiness

classDef bug fill:#f96,color:#f00,stroke:#f00,stroke-width:1px;
```
Expand Down
160 changes: 80 additions & 80 deletions docs/screenshots/orcid.org.0000-0002-1825-0097.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion iolanta/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def render_command( # noqa: WPS231, WPS238, WPS210, C901
)

try:
renderable, stack = iolanta.render(
renderable = iolanta.render(
node=URIRef(node),
as_datatype=URIRef(as_datatype),
)
Expand Down
21 changes: 1 addition & 20 deletions iolanta/facets/facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from rdflib.term import BNode, Literal, Node, URIRef

from iolanta.models import NotLiteralNode, Triple, TripleTemplate
from iolanta.stack import Stack
from ldflex import LDFlex
from ldflex.ldflex import QueryResult, SPARQLQueryArgument

Expand All @@ -21,7 +20,6 @@ class Facet(Generic[FacetOutput]):
iri: NotLiteralNode
iolanta: 'iolanta.Iolanta' = field(repr=False)
as_datatype: Optional[NotLiteralNode] = None
stack_children: List[Stack] = field(default_factory=list, repr=False)

@property
def stored_queries_path(self) -> Path:
Expand Down Expand Up @@ -58,15 +56,11 @@ def render(
as_datatype: NotLiteralNode,
) -> Any:
"""Shortcut to render something via iolanta."""
rendered, stack = self.iolanta.render(
return self.iolanta.render(
node=node,
as_datatype=as_datatype,
)

self.stack_children.append(stack)

return rendered

def render_all(
self,
node: Node,
Expand All @@ -92,19 +86,6 @@ def language(self) -> Literal:
"""Preferred language for Iolanta output."""
return self.iolanta.language

@property
def stack(self):
"""
Return stack.

FIXME: I have no idea. Maybe delete this nonsense.
"""
return Stack(
node=self.iri,
facet=self,
children=self.stack_children,
)

def find_triple(
self,
triple: TripleTemplate,
Expand Down
2 changes: 1 addition & 1 deletion iolanta/facets/page_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def construct_title(self):
return self.iolanta.render(
self.iri,
as_datatype=DATATYPES.title,
)[0]
)

def on_mount(self):
"""Initialize rendering of a title."""
Expand Down
2 changes: 1 addition & 1 deletion iolanta/facets/textual_browser/page_switcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def render_iri( # noqa: WPS210
self.iolanta.render,
facet,
as_datatype=DATATYPES.title,
)[0],
),
)
for facet in other_facets
]
Expand Down
2 changes: 1 addition & 1 deletion iolanta/facets/textual_class/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def render_newly_added_instances(self, instance_items: list[InstanceItem]):
self.app.iolanta.render(
instance_item.node,
as_datatype=DATATYPES.title,
)[0],
),
)

def stream_instance_items_chunk(
Expand Down
4 changes: 2 additions & 2 deletions iolanta/facets/textual_default/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(

def render_title(self):
"""Render title in a separate thread."""
return self.app.iolanta.render(self.iri, DATATYPES.title)[0]
return self.app.iolanta.render(self.iri, DATATYPES.title)

def render(self) -> RenderResult:
"""Render node title."""
Expand Down Expand Up @@ -202,7 +202,7 @@ def render_all_properties(self):
widget.renderable = self.app.iolanta.render(
widget.iri,
as_datatype=DATATYPES.title,
)[0]
)

def on_mount(self):
"""Initiate rendering in the background."""
Expand Down
2 changes: 1 addition & 1 deletion iolanta/facets/textual_graph/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def show(self) -> Widget:
triples_view = self.iolanta.render(
self.iri,
as_datatype=DATATYPES['textual-graph-triples'],
)[0]
)

return VerticalScroll(
PageTitle(self.iri, extra=f'({triple_count} triples)'),
Expand Down
2 changes: 1 addition & 1 deletion iolanta/facets/textual_graph_triples.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def render_triples(self):
term_view.renderable = self.iolanta.render(
term_view.uri,
as_datatype=term_view.as_datatype,
)[0]
)


class GraphTriplesFacet(Facet[Widget]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def compose(self):
yield self.iolanta.render(
row['assertion'],
as_datatype=DATATYPES['textual-graph-triples'],
)[0]
)

provenance = []
if row.get('author'):
Expand Down
2 changes: 1 addition & 1 deletion iolanta/facets/textual_nanopublication/term_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def render_terms(self):
child.renderable = self.iolanta.render(
child.uri,
as_datatype=child.as_datatype,
)[0]
)
5 changes: 2 additions & 3 deletions iolanta/iolanta.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
from iolanta.parsers.yaml import YAML
from iolanta.plugin import Plugin
from iolanta.resolvers.python_import import PythonImportResolver
from iolanta.stack import Stack
from ldflex import LDFlex


Expand Down Expand Up @@ -318,7 +317,7 @@ def render(
self,
node: Node,
as_datatype: NotLiteralNode,
) -> Tuple[Any, Stack]:
) -> Any:
"""Find an Iolanta facet for a node and render it."""
node = normalize_term(node)

Expand All @@ -345,7 +344,7 @@ def render(
)

try:
return facet.show(), facet.stack
return facet.show()

except Exception as err:
raise FacetError(
Expand Down
11 changes: 0 additions & 11 deletions iolanta/stack.py

This file was deleted.

17 changes: 1 addition & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "iolanta"
version = "1.2.11"
version = "2.0.0"
description = "Semantic Web browser"
authors = ["Anatoly Scherbakov <altaisoft@gmail.com>"]
license = "MIT"
Expand All @@ -26,7 +26,6 @@ owlrl = ">=6.0.2"
funcy = ">=2.0"
rich = ">=13.3.1"
textual = ">=0.83.0"
iolanta-tables = {version = "^0.1.7", optional = true}
yarl = ">=1.9.4"
boltons = ">=24.0.0"
yaml-ld = ">=1.1.7"
Expand Down
Loading