Comments (5)
What you try to do is combining two sets of results: those that have no count
, and those that have count > 10
. This is a job for the union
construct, whose sole purpose is merging two or more results into the query.
<table ?name ?count>
?name is a: MISC
union {
{
-- we need the next line to have '?name' within scope
?name is a: MISC
minus {
?name Count: ?count
}
}
{
?name Count: ?count
?count > 10
}
}
</table>
from dokuwiki-strata.
Feel free to close this issue if that worked.
from dokuwiki-strata.
I see. Yeah that makes sense now... I must confess I didn't really see what the union
construct was for, but now you mention that it makes sense.
I also realised a minor mistake in my example... if all three data entries are on the same page without fragment identifiers it goes a bit wrong.
As a more complete example (in case future readers are interested), the following does what I was asking for:
<data MISC #Bob>
Name: Bob Ross
Count: 3
</data>
<data MISC #Bill>
Name: Bill JJ
Count:
</data>
<data MISC #Ben>
Name: Ben Ten
Count: 15
</data>
<table ?item ?name ?count>
union {
{
-- we need the next line to have '?name' within scope
?item is a: MISC
?item Name: ?name
minus {
?item Count: ?count
}
}
{
?item is a: MISC
?item Name: ?name
?item Count: ?count
?count > 10
}
}
</table>
In words, table
the union
of two searches: (i) all items of type MISC
with a Name
field AND remove (aka minus
) all results with a Count
field defined; and (ii) all items of type MISC
with a Name
field and Count
field > 10
.
Also, after having a bit of a play, I think the following achieves the same thing:
<table ?item ?name ?count>
?item is a: MISC
?item Name: ?name
optional {
?item Count: ?count
}
minus {
?item Count: ?count2
?count2 <= 10
}
</table>
In words, table
all items of type MISC
with a Name
field AND optionally a Count
field AND remove (aka minus
) all items with a defined Count
field <= 10
.
I think the above two tables are equivalent... with the difference being how we minus
(aka remove) returned items.
There's a lot of power in the strata-plugin, I'm beginning to put multiple data entries on my wiki pages and using the table
has a sort of indexing/contents.
from dokuwiki-strata.
Glad you find it useful!
I'd also like to thank you for bringing these points to github. Having a record of how someone discovers the use of the plugin will be of great help when I finally have time to update the documentation.
from dokuwiki-strata.
Thank you for taking the time to answer my questions.
from dokuwiki-strata.
Related Issues (20)
- Preventing display of input data HOT 3
- How to get data to refresh? HOT 1
- Improved parsing/error messages
- link style and image sizes HOT 7
- hard limit results HOT 3
- Output a single value into another plugin's syntax HOT 1
- Multiple entries on one page HOT 2
- <table> tag not working properly HOT 5
- References with namespace don't work HOT 5
- Multiple values for expressions with * can't be used HOT 2
- ODT export issue HOT 1
- Effect of the "useheading" configuration setting HOT 2
- ~~INFO:stratatypes~~ crashes wiki HOT 4
- Table gives correct result only when predicate not correctly written HOT 4
- Suggestion: Include a query from another page HOT 4
- Type "wiki" does not work HOT 4
- Incorrect output for @sum aggregate HOT 2
- SQLite Access can not access strata tables HOT 2
- Scoped mode HOT 2
- Page title [[]] as part of Fragment HOT 2
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.
from dokuwiki-strata.